Package org.apache.juneau.marshall.hjson
Record Class HjsonTokenizer.Token
java.lang.Object
java.lang.Record
org.apache.juneau.marshall.hjson.HjsonTokenizer.Token
- Record Components:
type- Token type.stringValue- String value for STRING, QUOTELESS, MULTILINE tokens;null otherwise.numberValue- Number value for NUMBER tokens;null otherwise.
- Enclosing class:
- HjsonTokenizer
public static record HjsonTokenizer.Token(HjsonTokenizer.TokenType type, String stringValue, Number numberValue)
extends Record
A token with optional string or number value.
-
Constructor Summary
ConstructorsConstructorDescriptionToken(HjsonTokenizer.TokenType type, String stringValue, Number numberValue) Creates an instance of aTokenrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static HjsonTokenizer.TokenCreates a multiline-string token.static HjsonTokenizer.TokenCreates a number token.Returns the value of thenumberValuerecord component.static HjsonTokenizer.Tokenof(HjsonTokenizer.TokenType type) Creates a structural or literal token with no value.static HjsonTokenizer.TokenCreates a quoteless-string token.static HjsonTokenizer.TokenCreates a quoted-string token.Returns the value of thestringValuerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Token
Creates an instance of aTokenrecord class.- Parameters:
type- the value for thetyperecord componentstringValue- the value for thestringValuerecord componentnumberValue- the value for thenumberValuerecord component
-
-
Method Details
-
of
Creates a structural or literal token with no value.- Parameters:
type- Token type.- Returns:
- A new token.
-
string
Creates a quoted-string token.- Parameters:
value- The string value.- Returns:
- A new token.
-
quoteless
Creates a quoteless-string token.- Parameters:
value- The string value.- Returns:
- A new token.
-
multiline
Creates a multiline-string token.- Parameters:
value- The string value.- Returns:
- A new token.
-
number
Creates a number token.- Parameters:
value- The number value.- Returns:
- A new token.
-
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. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
stringValue
Returns the value of thestringValuerecord component.- Returns:
- the value of the
stringValuerecord component
-
numberValue
Returns the value of thenumberValuerecord component.- Returns:
- the value of the
numberValuerecord component
-