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 aPeriod
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic Period
day
(int year, int month) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static Period
hour
(int year, int month, int day, int hour) static Period
month
(int year, int month) int
period()
Returns the value of theperiod
record component.Returns the value of theperiodType
record component.final String
toString()
Returns a string representation of this record class.static Period
week
(int year, int week) int
year()
Returns the value of theyear
record component.static Period
year
(int year)
-
Constructor Details
-
Period
Creates an instance of aPeriod
record class.- Parameters:
periodType
- the value for theperiodType
record componentyear
- the value for theyear
record componentperiod
- the value for theperiod
record 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 theperiodType
record component.- Returns:
- the value of the
periodType
record component
-
year
public int year()Returns the value of theyear
record component.- Returns:
- the value of the
year
record component
-
period
public int period()Returns the value of theperiod
record component.- Returns:
- the value of the
period
record component
-