Package jsonvalues

Class JsNumber

All Implemented Interfaces:
JsValue
Direct Known Subclasses:
JsBigDec, JsBigInt, JsDouble, JsInt, JsLong

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.

See Also:
  • Constructor Details

    • JsNumber

      public JsNumber()
  • Method Details

    • toJsPrimitive

      public JsPrimitive 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.