Class JsonNumber
java.lang.Object
name.martingeisse.grumpyjson.json_model.JsonElement
name.martingeisse.grumpyjson.json_model.JsonNumber
This class represents JSON numbers.
-
Method Summary
Modifier and TypeMethodDescriptionIf this JSON element is not a JSON number, this method throws aJsonDeserializationException, otherwise it returns the numeric value.booleangetValue()Getter method.inthashCode()static JsonNumberCreates an instance of this class for the specified plain numeric value.toString()Methods inherited from class name.martingeisse.grumpyjson.json_model.JsonElement
deserializerExpectsArray, deserializerExpectsBoolean, deserializerExpectsNull, deserializerExpectsObject, deserializerExpectsString
-
Method Details
-
of
Creates an instance of this class for the specified plain numeric value.To guarantee immutability of the whole JSON structure, the argument must be an immutable
Numberinstance itself.- Parameters:
value- the numeric value -- must be immutable- Returns:
- the JSON number
-
getValue
Getter method.- Returns:
- the value of this JSON number
-
deserializerExpectsNumber
Description copied from class:JsonElementIf this JSON element is not a JSON number, this method throws aJsonDeserializationException, otherwise it returns the numeric value.- Overrides:
deserializerExpectsNumberin classJsonElement- Returns:
- the numeric value
-
equals
-
hashCode
public int hashCode() -
toString
-