Package com.oorian.json
Class JsonNumber
java.lang.Object
com.oorian.json.JsonValue
com.oorian.json.JsonNumber
Represents a JSON number value.
JsonNumber wraps a Java Number and supports all numeric types including
integers, longs, floats, and doubles.
-
Constructor Summary
ConstructorsConstructorDescriptionJsonNumber(Number value) Creates a new JsonNumber with the specified numeric value. -
Method Summary
Modifier and TypeMethodDescriptiongetValue()Returns the underlying numeric value.Returns this value serialized as a JSON string.
-
Constructor Details
-
JsonNumber
Creates a new JsonNumber with the specified numeric value.- Parameters:
value- the numeric value.
-
-
Method Details
-
getValue
Returns the underlying numeric value.- Returns:
- the Number value.
-
toJsonString
Description copied from class:JsonValueReturns this value serialized as a JSON string.- Specified by:
toJsonStringin classJsonValue- Returns:
- the JSON string representation.
-