Package jsonvalues
Class JsPrimitive
java.lang.Object
jsonvalues.JsPrimitive
- All Implemented Interfaces:
JsValue
public abstract sealed class JsPrimitive
extends Object
implements JsValue
permits JsBinary, JsBool, JsInstant, JsNull, JsNumber, JsStr
Represents a sealed abstract class for primitive JSON values. It serves as a common base class for various primitive
JSON types, such as numbers, strings, booleans, and others. Instances of this class are immutable.
This class is part of a sealed hierarchy and permits specific subclasses for different JSON primitive types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisJson()Returns true if this JsValue is a Json (JsObj or JsArray).booleanReturns true if this JsValue is not a Json (neither JsObj nor JsArray).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jsonvalues.JsValue
ifNothing, ifNull, isArray, isArray, isBigDec, isBigDec, isBigInt, isBigInt, isBinary, isBool, isDecimal, isDouble, isDouble, isFalse, isInstant, isInstant, isInt, isInt, isIntegral, isJson, isLong, isLong, isNothing, isNotNothing, isNotNull, isNotNumber, isNull, isNumber, isObj, isObj, isSameType, isStr, isStr, isTrue, toJsArray, toJsBigDec, toJsBigInt, toJsBinary, toJsBool, toJsDouble, toJsInstant, toJsInt, toJsLong, toJsNumber, toJsObj, toJson, toJsPrimitive, toJsStr
-
Constructor Details
-
JsPrimitive
public JsPrimitive()
-
-
Method Details
-
isPrimitive
public boolean isPrimitive()Description copied from interface:JsValueReturns true if this JsValue is not a Json (neither JsObj nor JsArray).- Specified by:
isPrimitivein interfaceJsValue- Returns:
- True if this JsValue is not a Json (neither JsObj nor JsArray).
-
isJson
public boolean isJson()Description copied from interface:JsValueReturns true if this JsValue is a Json (JsObj or JsArray).
-