public final class JsStr extends JsPrimitive implements Comparable<JsStr>
Modifier and Type | Field and Description |
---|---|
static fun.optic.Prism<String,byte[]> |
base64Prism |
static fun.optic.Prism<String,Instant> |
instantPrism |
static fun.optic.Prism<JsValue,String> |
prism
prism between the sum type JsValue and JsStr
|
static int |
TYPE_ID |
String |
value
The string value.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(JsStr o)
Compares two
JsStr objects lexicographically. |
boolean |
equals(Object that)
Indicates whether some other object is "equal to" this json string.
|
int |
hashCode()
Returns the hashcode of this json string.
|
int |
id() |
boolean |
isBinary()
Returns true if this JsValue is a JsBinary or a JsString which value is an array of
|
boolean |
isInstant()
Returns true if this JsValue is a JsInstant or a JsString which value is a
date formatted in ISO-8601
|
boolean |
isStr()
Returns true if this JsValue is a JsStr
|
JsStr |
map(UnaryOperator<String> fn)
Maps this JsStr into another one.
|
static JsStr |
of(String str)
Static factory method to create a JsStr from a string.
|
boolean |
test(Predicate<String> predicate)
Tests this JsStr on a predicate.
|
JsPrimitive |
toJsPrimitive() |
String |
toString()
Returns the string representation of this json string which is its value quoted.
|
isJson, isPrimitive
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
ifNothing, ifNull, isArray, isArray, isBigDec, isBigDec, isBigInt, isBigInt, isBool, isDecimal, isDouble, isDouble, isFalse, isInstant, isInt, isInt, isIntegral, isJson, isLong, isLong, isNothing, isNotNothing, isNotNull, isNotNumber, isNull, isNumber, isObj, isObj, isSameType, isStr, isTrue, toJsArray, toJsBigDec, toJsBigInt, toJsBinary, toJsBool, toJsDouble, toJsInstant, toJsInt, toJsLong, toJsNumber, toJsObj, toJson, toJsStr
public static final int TYPE_ID
public static final fun.optic.Prism<JsValue,String> prism
public static final fun.optic.Prism<String,byte[]> base64Prism
public final String value
public static JsStr of(String str)
str
- the stringpublic JsPrimitive toJsPrimitive()
toJsPrimitive
in interface JsValue
public boolean isStr()
JsValue
public int compareTo(JsStr o)
JsStr
objects lexicographically.compareTo
in interface Comparable<JsStr>
String.compareTo(String)
public boolean test(Predicate<String> predicate)
predicate
- the predicatepublic int hashCode()
public boolean equals(Object that)
public String toString()
public JsStr map(UnaryOperator<String> fn)
fn
- the mapping functionpublic boolean isBinary()
JsValue
public boolean isInstant()
JsValue
Copyright © 2022. All rights reserved.