Record Class StringName
java.lang.Object
java.lang.Record
org.microbean.construct.element.StringName
- Record Components:
value- the actual name; must not benulldomain- aDomain; must not benull
- All Implemented Interfaces:
CharSequence,Constable,Name
- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionStringName(CharSequence value, Domain domain) Creates a newStringName.StringName(String value, Domain domain) Creates a newStringName. -
Method Summary
Modifier and TypeMethodDescriptionfinal charcharAt(int index) final IntStreamchars()final IntStreamfinal booleanfinal Optional<? extends ConstantDesc> domain()Returns the value of thedomainrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final booleanisEmpty()final intlength()static final StringNameof(CharSequence cs, Domain domain) Returns aStringNamewhosevalue()method will return aStringequal to theStringconversion of the suppliedCharSequence, and whosedomain()method will return aDomainequal to the suppliedDomain.final CharSequencesubSequence(int start, int end) final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
StringName
Creates a newStringName.- Parameters:
value- the actual name; must not benulldomain- aDomain; must not benull- Throws:
NullPointerException- if either argument isnull
-
StringName
Creates a newStringName.- Parameters:
value- the actual name; must not benulldomain- aDomain; must not benull- Throws:
NullPointerException- if either argument isnull
-
-
Method Details
-
charAt
- Specified by:
charAtin interfaceCharSequence
-
chars
- Specified by:
charsin interfaceCharSequence
-
codePoints
- Specified by:
codePointsin interfaceCharSequence
-
contentEquals
- Specified by:
contentEqualsin interfaceName
-
describeConstable
- Specified by:
describeConstablein interfaceConstable
-
isEmpty
- Specified by:
isEmptyin interfaceCharSequence
-
length
- Specified by:
lengthin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein 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:
toStringin interfaceCharSequence- Specified by:
toStringin classRecord- Returns:
- a string representation of this object
-
of
Returns aStringNamewhosevalue()method will return aStringequal to theStringconversion of the suppliedCharSequence, and whosedomain()method will return aDomainequal to the suppliedDomain.- Parameters:
cs- aCharSequence; must not benulldomain- 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
-