Record Class StringName
java.lang.Object
java.lang.Record
org.microbean.construct.element.StringName
- Record Components:
value
- the actual name; must not benull
domain
- aDomain
; must not benull
- All Implemented Interfaces:
CharSequence
,Constable
,Name
- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
ConstructorDescriptionStringName
(CharSequence value, Domain domain) Creates a newStringName
.StringName
(String value, Domain domain) Creates a newStringName
. -
Method Summary
Modifier and TypeMethodDescriptionfinal char
charAt
(int index) final IntStream
chars()
final IntStream
final boolean
final Optional
<? extends ConstantDesc> domain()
Returns the value of thedomain
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.final boolean
isEmpty()
final int
length()
static final StringName
of
(CharSequence cs, Domain domain) Returns aStringName
whosevalue()
method will return aString
equal to theString
conversion of the suppliedCharSequence
, and whosedomain()
method will return aDomain
equal to the suppliedDomain
.final CharSequence
subSequence
(int start, int end) final String
toString()
Returns a string representation of this record class.value()
Returns the value of thevalue
record component.
-
Constructor Details
-
StringName
Creates a newStringName
.- Parameters:
value
- the actual name; must not benull
domain
- aDomain
; must not benull
- Throws:
NullPointerException
- if either argument isnull
-
StringName
Creates a newStringName
.- Parameters:
value
- the actual name; must not benull
domain
- aDomain
; must not benull
- Throws:
NullPointerException
- if either argument isnull
-
-
Method Details
-
charAt
- Specified by:
charAt
in interfaceCharSequence
-
chars
- Specified by:
chars
in interfaceCharSequence
-
codePoints
- Specified by:
codePoints
in interfaceCharSequence
-
contentEquals
- Specified by:
contentEquals
in interfaceName
-
describeConstable
- Specified by:
describeConstable
in interfaceConstable
-
isEmpty
- Specified by:
isEmpty
in interfaceCharSequence
-
length
- Specified by:
length
in interfaceCharSequence
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
-
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.- Specified by:
toString
in interfaceCharSequence
- Specified by:
toString
in classRecord
- Returns:
- a string representation of this object
-
of
Returns aStringName
whosevalue()
method will return aString
equal to theString
conversion of the suppliedCharSequence
, and whosedomain()
method will return aDomain
equal to the suppliedDomain
.- Parameters:
cs
- aCharSequence
; must not benull
domain
- aDomain
; must not benull
- Returns:
- a
StringName
; nevernull
- Throws:
NullPointerException
- if either argument isnull
- See Also:
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
value
-
domain
-