Class Date (2.13.0)

public final class Date extends GeneratedMessageV3 implements DateOrBuilder

Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following:

  • A full date, with non-zero year, month, and day values
  • A month and day value, with a zero year, such as an anniversary
  • A year on its own, with zero month and day values
  • A year and month value, with a zero day, such as a credit card expiration date Related types are google.type.TimeOfDay and google.protobuf.Timestamp.

Protobuf type google.type.Date

Implements

DateOrBuilder

Static Fields

DAY_FIELD_NUMBER

public static final int DAY_FIELD_NUMBER
Field Value
TypeDescription
int

MONTH_FIELD_NUMBER

public static final int MONTH_FIELD_NUMBER
Field Value
TypeDescription
int

YEAR_FIELD_NUMBER

public static final int YEAR_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Date getDefaultInstance()
Returns
TypeDescription
Date

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Date.Builder newBuilder()
Returns
TypeDescription
Date.Builder

newBuilder(Date prototype)

public static Date.Builder newBuilder(Date prototype)
Parameter
NameDescription
prototypeDate
Returns
TypeDescription
Date.Builder

parseDelimitedFrom(InputStream input)

public static Date parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Date
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Date parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Date
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Date parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Date
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Date parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Date
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Date parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Date
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Date parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Date
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Date parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Date
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Date parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Date
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Date parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Date
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Date parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Date
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Date parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Date
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Date parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Date
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Date> parser()
Returns
TypeDescription
Parser<Date>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDay()

public int getDay()

Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

int32 day = 3;

Returns
TypeDescription
int

The day.

getDefaultInstanceForType()

public Date getDefaultInstanceForType()
Returns
TypeDescription
Date

getMonth()

public int getMonth()

Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

int32 month = 2;

Returns
TypeDescription
int

The month.

getParserForType()

public Parser<Date> getParserForType()
Returns
TypeDescription
Parser<Date>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

getYear()

public int getYear()

Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

int32 year = 1;

Returns
TypeDescription
int

The year.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Date.Builder newBuilderForType()
Returns
TypeDescription
Date.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Date.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Date.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Date.Builder toBuilder()
Returns
TypeDescription
Date.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException