java.lang.Object
jsonvalues.JsPrimitive
jsonvalues.JsNumber
- All Implemented Interfaces:
JsValue
public abstract sealed class JsNumber
extends JsPrimitive
permits JsBigDec, JsBigInt, JsDouble, JsInt, JsLong
Represents a sealed abstract class for JSON number values. It serves as a common base class for various
numeric JSON types, such as integers and floating-point numbers. Instances of this class are immutable.
This class is part of a sealed hierarchy and permits specific subclasses for different numeric JSON types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isNumber()
Indicates whether this JSON number is of numeric type.Returns this JsValue as a JsPrimitive.Methods inherited from class jsonvalues.JsPrimitive
isJson, isPrimitive
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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, isObj, isObj, isSameType, isStr, isStr, isTrue, toJsArray, toJsBigDec, toJsBigInt, toJsBinary, toJsBool, toJsDouble, toJsInstant, toJsInt, toJsLong, toJsNumber, toJsObj, toJson, toJsStr
-
Constructor Details
-
JsNumber
public JsNumber()
-
-
Method Details
-
toJsPrimitive
Description copied from interface:JsValue
Returns this JsValue as a JsPrimitive.- Returns:
- This JsValue as a JsPrimitive.
-
isNumber
public boolean isNumber()Indicates whether this JSON number is of numeric type.- Returns:
- true if this JSON number is of numeric type, otherwise false.
-