Package io.kjson
Class JSONString
-
- All Implemented Interfaces:
-
io.kjson.JSONPrimitive,io.kjson.JSONValue,kotlin.CharSequence
public final class JSONString implements JSONPrimitive<String>, CharSequence
A JSON string value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classJSONString.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Integerlengthprivate final StringasStringprivate final StringasStringOrNullprivate final Stringvaluepublic final static JSONString.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description JSONString(String value)
-
Method Summary
Modifier and Type Method Description IntegergetLength()The length of the string final StringgetAsString()final StringgetAsStringOrNull()StringgetValue()The value, of the appropriate type. Characterget(Integer index)Get a single Char from the string. JSONStringsubSequence(Integer startIndex, Integer endIndex)Create a new JSONString from a sub-sequence of the value, using the specified start and end indices. UnitappendTo(Appendable a)Append as a JSON string to an Appendable. Unitoutput(IntConsumer out)Output as a JSON string to an IntConsumer. UnitcoOutput(SuspendFunction1<Character, Unit> out)Output as a JSON string to a CoOutput. Booleanequals(Object other)Compare the value to another value. IntegerhashCode()Get the hash code for the JSONString value. StringtoString()Get the string value. -
-
Constructor Detail
-
JSONString
JSONString(String value)
-
-
Method Detail
-
getAsString
final String getAsString()
-
getAsStringOrNull
final String getAsStringOrNull()
-
subSequence
JSONString subSequence(Integer startIndex, Integer endIndex)
Create a new JSONString from a sub-sequence of the value, using the specified start and end indices.
-
appendTo
Unit appendTo(Appendable a)
Append as a JSON string to an Appendable.
-
output
Unit output(IntConsumer out)
Output as a JSON string to an IntConsumer.
-
coOutput
Unit coOutput(SuspendFunction1<Character, Unit> out)
Output as a JSON string to a CoOutput.
-
hashCode
Integer hashCode()
Get the hash code for the JSONString value.
-
-
-
-