Record Class CharArray
java.lang.Object
java.lang.Record
org.aspectj.org.eclipse.jdt.internal.compiler.util.CharArray
- All Implemented Interfaces:
Comparable<CharArray>
Wrapper around char arrays that can be used as a key in a Map or Set.
The hashCode() and equals(Object) method will work with the underlying array using
Arrays.hashCode and Arrays.equals.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanIndicates whether some other object is "equal to" this one.char[]getKey()inthashCode()Returns a hash code value for this object.char[]key()Returns the value of thekeyrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
CharArray
public CharArray(char[] key) Creates an instance of aCharArrayrecord class.- Parameters:
key- the value for thekeyrecord component
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<CharArray>
-
getKey
public char[] getKey() -
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). -
hashCode
-
toString
-
key
public char[] key()Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-