Package com.storedobject.iot
Record Class Period
java.lang.Object
java.lang.Record
com.storedobject.iot.Period
-
Constructor Summary
ConstructorsConstructorDescriptionPeriod(PeriodType periodType, int year, int period) Creates an instance of aPeriodrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic Periodday(int year, int month) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static Periodhour(int year, int month, int day, int hour) static Periodmonth(int year, int month) intperiod()Returns the value of theperiodrecord component.Returns the value of theperiodTyperecord component.final StringtoString()Returns a string representation of this record class.static Periodweek(int year, int week) intyear()Returns the value of theyearrecord component.static Periodyear(int year)
-
Constructor Details
-
Period
Creates an instance of aPeriodrecord class.- Parameters:
periodType- the value for theperiodTyperecord componentyear- the value for theyearrecord componentperiod- the value for theperiodrecord component
-
-
Method Details
-
year
-
month
-
day
-
hour
-
week
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
periodType
Returns the value of theperiodTyperecord component.- Returns:
- the value of the
periodTyperecord component
-
year
public int year()Returns the value of theyearrecord component.- Returns:
- the value of the
yearrecord component
-
period
public int period()Returns the value of theperiodrecord component.- Returns:
- the value of the
periodrecord component
-