Package no.priv.bang.handlereg.services
Record Class SumYear
java.lang.Object
java.lang.Record
no.priv.bang.handlereg.services.SumYear
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doublesum()Returns the value of thesumrecord component.final StringtoString()Returns a string representation of this record class.static SumYear.Builderwith()year()Returns the value of theyearrecord component.
-
Field Details
-
sum
private final double sumThe field for thesumrecord component. -
year
The field for theyearrecord component.
-
-
Constructor Details
-
SumYear
Creates an instance of aSumYearrecord class.- Parameters:
sum- the value for thesumrecord componentyear- the value for theyearrecord component
-
-
Method Details
-
with
-
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 '=='. -
sum
public double sum()Returns the value of thesumrecord component.- Returns:
- the value of the
sumrecord component
-
year
Returns the value of theyearrecord component.- Returns:
- the value of the
yearrecord component
-