Package org.midheaven.math
Record Class DividerAndRemainder<T>
java.lang.Object
java.lang.Record
org.midheaven.math.DividerAndRemainder<T>
- Type Parameters:
T- type of the result
Immutable record for Divider And Remainder.
-
Constructor Summary
ConstructorsConstructorDescriptionDividerAndRemainder(T divider, T remainder) Creates an instance of aDividerAndRemainderrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondivider()Returns the value of thedividerrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theremainderrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DividerAndRemainder
Creates an instance of aDividerAndRemainderrecord class.- Parameters:
divider- the value for thedividerrecord componentremainder- the value for theremainderrecord component
-
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
divider
Returns the value of thedividerrecord component.- Returns:
- the value of the
dividerrecord component
-
remainder
Returns the value of theremainderrecord component.- Returns:
- the value of the
remainderrecord component
-