java.lang.Object
jsonvalues.JsPrimitive
jsonvalues.JsNumber
jsonvalues.JsBigDec
- All Implemented Interfaces:
Comparable<JsBigDec>,JsValue
Represents an immutable JSON number of type BigDecimal.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final fun.optic.Prism<JsValue,BigDecimal> prism between the sum type JsValue and JsBigDecfinal BigDecimalThe big decimal value -
Method Summary
Modifier and TypeMethodDescriptionintCompares twoJsBigDecobjects numericallybooleanIndicates whether some other object is "equal to" this JSON big decimal.inthashCode()Returns the hashcode of this JSON big decimalbooleanisBigDec()Returns true if this JsValue is a JsBigDecmap(UnaryOperator<BigDecimal> fn) Maps this JsBigDec into another onestatic JsBigDecof(BigDecimal n) Static factory method to create a JsBigDec from a BigDecimal object.booleantest(Predicate<BigDecimal> predicate) Tests the value of this JSON big-decimal on a predicatetoString()Methods inherited from class jsonvalues.JsNumber
isNumber, toJsPrimitiveMethods inherited from class jsonvalues.JsPrimitive
isJson, isPrimitiveMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jsonvalues.JsValue
ifNothing, ifNull, isArray, isArray, 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
-
Field Details
-
prism
prism between the sum type JsValue and JsBigDec -
value
The big decimal value
-
-
Method Details
-
of
Static factory method to create a JsBigDec from a BigDecimal object.- Parameters:
n- the big decimal- Returns:
- a new JsBigDec
-
isBigDec
public boolean isBigDec()Description copied from interface:JsValueReturns true if this JsValue is a JsBigDec -
compareTo
Compares twoJsBigDecobjects numerically- Specified by:
compareToin interfaceComparable<JsBigDec>- See Also:
-
hashCode
public int hashCode()Returns the hashcode of this JSON big decimal -
equals
Indicates whether some other object is "equal to" this JSON big decimal. Numbers of different types are equals if they have the same value. -
toString
-
map
Maps this JsBigDec into another one- Parameters:
fn- the mapping function- Returns:
- a new JsBigDec
-
test
Tests the value of this JSON big-decimal on a predicate- Parameters:
predicate- the predicate- Returns:
- true if this big decimal satisfies the predicate
-