Class McpJsonNumber
java.lang.Object
com.soklet.McpJsonNumber
- All Implemented Interfaces:
McpJsonValue
An immutable, exactly represented JSON number.
Equality and hashing compare numeric values regardless of decimal scale.
For example, 1, 1.0 and 1E+0 are equal. The supplied
BigDecimal, including its scale, remains available from
getValue().
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic @NonNull McpJsonNumberfromValue(@NonNull BigDecimal value) Creates an immutable, exactly represented JSON number from its value.getValue()inthashCode()toString()
-
Method Details
-
fromValue
Creates an immutable, exactly represented JSON number from its value.- Parameters:
value- the non-null numeric value- Returns:
- immutable JSON number
-
getValue
- Returns:
- exactly represented numeric value, retaining the supplied scale
-
equals
-
hashCode
-
toString
-