Record Class AsciiString
java.lang.Object
java.lang.Record
org.jgroups.util.AsciiString
- Record Components:
val- The value as a byte array
- All Implemented Interfaces:
Comparable<AsciiString>
Simple string implemented as a byte[] array. Each character's higher 8 bits are truncated and
only the lower 8 bits are stored. AsciiString is mutable for efficiency reasons, but the chars array should never
be changed !
- Since:
- 3.5
- Author:
- Bela Ban
-
Constructor Summary
ConstructorsConstructorDescriptionAsciiString(byte[] val) Creates an instance of aAsciiStringrecord class.AsciiString(String str) AsciiString(AsciiString str) -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(AsciiString str) booleanequals(byte[] other) booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.intlength()toString()Returns a string representation of this record class.byte[]val()Returns the value of thevalrecord component.
-
Constructor Details
-
AsciiString
-
AsciiString
-
AsciiString
public AsciiString(byte[] val) Creates an instance of aAsciiStringrecord class.- Parameters:
val- the value for thevalrecord component
-
-
Method Details
-
length
public int length() -
compareTo
- Specified by:
compareToin interfaceComparable<AsciiString>
-
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). -
equals
public boolean equals(byte[] other) -
hashCode
-
toString
-
val
-