Record Class StringValue
java.lang.Object
java.lang.Record
org.microbean.attributes.StringValue
- Record Components:
value
- the value
- All Implemented Interfaces:
Comparable<StringValue>
,Constable
,Value<StringValue>
A
Value
whose value is a String
.- Author:
- Laird Nelson
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal int
compareTo
(StringValue other) final Optional
<DynamicConstantDesc<StringValue>> final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static final StringValue
Returns aStringValue
suitable for the supplied arguments.final String
toString()
Returns a string representation of this record class.value()
Returns the value of thevalue
record component.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
StringValue
Creates a newStringValue
.- Parameters:
value
- the value; must not benull
- Throws:
NullPointerException
- ifvalue
isnull
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<StringValue>
-
describeConstable
- Specified by:
describeConstable
in interfaceConstable
-
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
-
of
Returns aStringValue
suitable for the supplied arguments.- Parameters:
s
- a non-null
String
- Returns:
- a non-
null
StringValue
- Throws:
NullPointerException
- ifs
isnull
-
value
-