com.google.api.server.spi.types
Class SimpleDate
- java.lang.Object
-
- com.google.api.server.spi.types.SimpleDate
-
public class SimpleDate extends java.lang.ObjectA class for storing simple date values without a time component.
-
-
Constructor Summary
Constructors Constructor and Description SimpleDate(int year, int month, int day)Constructs a new simple date.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object obj)intgetDay()Gets the calendar day; this should be between 1 and 31.intgetMonth()Gets the calendar month number.intgetYear()Gets the calendar year.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
SimpleDate
public SimpleDate(int year, int month, int day)Constructs a new simple date.- Parameters:
year- the full year numbermonth- a month number between 1-12day- a day number between 1-31- Throws:
java.lang.IllegalArgumentException- throws if the date is invalid, or the year is outside the RFC3339 supported range
-
-
Method Detail
-
getYear
public int getYear()
Gets the calendar year.- Returns:
- the full year number
-
getMonth
public int getMonth()
Gets the calendar month number. This would return 1 for January, and 12 for December.- Returns:
- the month number
-
getDay
public int getDay()
Gets the calendar day; this should be between 1 and 31.- Returns:
- the day number
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-