Record Class SequencedCollectionsExamples.MapOrderSummary
java.lang.Object
java.lang.Record
net.jrodolfo.java_evolution.java21.SequencedCollectionsExamples.MapOrderSummary
- Record Components:
firstKey- the first key in encounter orderfirstValue- the first value in encounter orderlastKey- the last key in encounter orderlastValue- the last value in encounter order
- Enclosing class:
SequencedCollectionsExamples
public static record SequencedCollectionsExamples.MapOrderSummary(int firstKey, String firstValue, int lastKey, String lastValue)
extends Record
Captures direct observations from
SequencedMap.-
Constructor Summary
ConstructorsConstructorDescriptionMapOrderSummary(int firstKey, String firstValue, int lastKey, String lastValue) Creates an instance of aMapOrderSummaryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intfirstKey()Returns the value of thefirstKeyrecord component.Returns the value of thefirstValuerecord component.final inthashCode()Returns a hash code value for this object.intlastKey()Returns the value of thelastKeyrecord component.Returns the value of thelastValuerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MapOrderSummary
Creates an instance of aMapOrderSummaryrecord class.- Parameters:
firstKey- the value for thefirstKeyrecord componentfirstValue- the value for thefirstValuerecord componentlastKey- the value for thelastKeyrecord componentlastValue- the value for thelastValuerecord component
-
-
Method Details
-
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 thecomparemethod from their corresponding wrapper classes. -
firstKey
-
firstValue
Returns the value of thefirstValuerecord component.- Returns:
- the value of the
firstValuerecord component
-
lastKey
-
lastValue
-