java.lang.Object
java.lang.Record
dev.hloth.zgztransport.JourneySummary.LastPaid
- Record Components:
date- the dayhour-0to23minute-0to59
- Enclosing class:
JourneySummary
When the last paid journey happened, which the card records to the minute.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondate()Returns the value of thedaterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.inthour()Returns the value of thehourrecord component.intminute()Returns the value of theminuterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LastPaid
Checks the ranges of the two fields and that the date is present.- Throws:
IllegalArgumentException- if the hour or the minute is outside its rangeNullPointerException- if the date is null
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
date
Returns the value of thedaterecord component.- Returns:
- the value of the
daterecord component
-
hour
public int hour()Returns the value of thehourrecord component.- Returns:
- the value of the
hourrecord component
-
minute
public int minute()Returns the value of theminuterecord component.- Returns:
- the value of the
minuterecord component
-