java.lang.Object
jsonvalues.JsPrimitive
jsonvalues.JsStr
- All Implemented Interfaces:
Comparable<JsStr>,JsValue
Represents an immutable JSON string.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintCompares twoJsStrobjects lexicographically.booleanIndicates whether some other object is "equal to" this json string.inthashCode()Returns the hashcode of this json string.booleanisBinary()Returns true if this JsValue is a JsBinary or a JsString which value is an array ofbooleanReturns true if this JsValue is a JsInstant or a JsString which value is a date formatted in ISO-8601booleanisStr()Returns true if this JsValue is a JsStrmap(UnaryOperator<String> fn) Maps this JsStr into another one.static JsStrStatic factory method to create a JsStr from a string.booleanTests this JsStr on a predicate.toString()Returns the string representation of this json string which is its value quoted.Methods inherited from class jsonvalues.JsPrimitive
isJson, isPrimitiveMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jsonvalues.JsValue
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
-
Field Details
-
prism
prism between the sum type JsValue and JsStr -
base64Prism
-
instantPrism
-
value
The string value.
-
-
Method Details
-
of
Static factory method to create a JsStr from a string.- Parameters:
str- the string- Returns:
- a new JsStr
-
toJsPrimitive
- Specified by:
toJsPrimitivein interfaceJsValue
-
isStr
public boolean isStr()Description copied from interface:JsValueReturns true if this JsValue is a JsStr -
compareTo
Compares twoJsStrobjects lexicographically.- Specified by:
compareToin interfaceComparable<JsStr>- See Also:
-
test
Tests this JsStr on a predicate.- Parameters:
predicate- the predicate- Returns:
- true if this string satisfies the predicate
-
hashCode
public int hashCode()Returns the hashcode of this json string. -
equals
Indicates whether some other object is "equal to" this json string. -
toString
Returns the string representation of this json string which is its value quoted. -
map
Maps this JsStr into another one.- Parameters:
fn- the mapping function- Returns:
- a new JsStr
-
isBinary
public boolean isBinary()Description copied from interface:JsValueReturns true if this JsValue is a JsBinary or a JsString which value is an array of -
isInstant
public boolean isInstant()Description copied from interface:JsValueReturns true if this JsValue is a JsInstant or a JsString which value is a date formatted in ISO-8601
-