Class Date.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<MessageType,BuilderType>
com.google.protobuf.GeneratedMessageLite.Builder<Date,Date.Builder>
com.google.type.Date.Builder
All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, DateOrBuilder, Cloneable
Enclosing class:
Date

public static final class Date.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<Date,Date.Builder> 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][google.type.TimeOfDay] and
 `google.protobuf.Timestamp`.
 
Protobuf type google.type.Date
  • Field Summary

    Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder

    instance
  • Method Summary

    Modifier and Type
    Method
    Description
    Day of a month.
    Month of a year.
    Year of the date.
    int
    Day of a month.
    int
    Month of a year.
    int
    Year of the date.
    setDay(int value)
    Day of a month.
    setMonth(int value)
    Month of a year.
    setYear(int value)
    Year of the date.

    Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder

    build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFrom

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder

    getDefaultInstanceForType, isInitialized
  • Method Details

    • 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 [json_name = "year"];
      Specified by:
      getYear in interface DateOrBuilder
      Returns:
      The year.
    • setYear

      public Date.Builder setYear(int value)
       Year of the date. Must be from 1 to 9999, or 0 to specify a date without
       a year.
       
      int32 year = 1 [json_name = "year"];
      Parameters:
      value - The year to set.
      Returns:
      This builder for chaining.
    • clearYear

      public Date.Builder clearYear()
       Year of the date. Must be from 1 to 9999, or 0 to specify a date without
       a year.
       
      int32 year = 1 [json_name = "year"];
      Returns:
      This builder for chaining.
    • 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 [json_name = "month"];
      Specified by:
      getMonth in interface DateOrBuilder
      Returns:
      The month.
    • setMonth

      public Date.Builder setMonth(int value)
       Month of a year. Must be from 1 to 12, or 0 to specify a year without a
       month and day.
       
      int32 month = 2 [json_name = "month"];
      Parameters:
      value - The month to set.
      Returns:
      This builder for chaining.
    • clearMonth

      public Date.Builder clearMonth()
       Month of a year. Must be from 1 to 12, or 0 to specify a year without a
       month and day.
       
      int32 month = 2 [json_name = "month"];
      Returns:
      This builder for chaining.
    • 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 [json_name = "day"];
      Specified by:
      getDay in interface DateOrBuilder
      Returns:
      The day.
    • setDay

      public Date.Builder setDay(int value)
       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 [json_name = "day"];
      Parameters:
      value - The day to set.
      Returns:
      This builder for chaining.
    • clearDay

      public Date.Builder clearDay()
       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 [json_name = "day"];
      Returns:
      This builder for chaining.