Package jsonvalues
Class JsBigDec
- java.lang.Object
-
- jsonvalues.JsNumber
-
- jsonvalues.JsBigDec
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(JsBigDec o)Compares twoJsBigDecobjects numericallybooleanequals(java.lang.Object that)Indicates whether some other object is "equal to" this json big decimal.inthashCode()Returns the hashcode of this json big decimalintid()booleanisBigDec()JsBigDecmap(java.util.function.UnaryOperator<java.math.BigDecimal> fn)Maps this JsBigDec into another onestatic JsBigDecof(java.math.BigDecimal n)Static factory method to create a JsBigDec from a BigDecimal object.booleantest(java.util.function.Predicate<java.math.BigDecimal> predicate)Tests the value of this json bigdec on a predicatejava.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jsonvalues.JsValue
ifNothing, ifNull, isArray, isArray, isBigDec, isBigInt, isBigInt, isBinary, isBool, isDecimal, isDouble, isDouble, isFalse, isInstant, isInstant, isInt, isInt, isIntegral, isJson, isJson, isLong, isLong, isNothing, isNotJson, isNotNothing, isNotNull, isNotNumber, isNull, isObj, isObj, isSameType, isStr, isStr, isTrue, toJsArray, toJsBigDec, toJsBigInt, toJsBinary, toJsBool, toJsDouble, toJsInstant, toJsInt, toJsLong, toJsNumber, toJsObj, toJson, toJsStr
-
-
-
-
Field Detail
-
ID
public static final int ID
- See Also:
- Constant Field Values
-
prism
public static Prism<JsValue,java.math.BigDecimal> prism
prism between the sum type JsValue and JsBigDec
-
value
public final java.math.BigDecimal value
The big decimal value
-
-
Method Detail
-
isBigDec
public boolean isBigDec()
-
compareTo
public int compareTo(JsBigDec o)
Compares twoJsBigDecobjects numerically- Specified by:
compareToin interfacejava.lang.Comparable<JsBigDec>- See Also:
compareTo(JsBigDec)
-
hashCode
public int hashCode()
Returns the hashcode of this json big decimal- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hashcode of this JsBigDec
-
equals
public boolean equals(java.lang.Object that)
Indicates whether some other object is "equal to" this json big decimal. Numbers of different types are equals if the have the same value.- Overrides:
equalsin classjava.lang.Object- Parameters:
that- the reference object with which to compare.- Returns:
- true if that is a JsNumber with the same value as this
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of the bigdec value
- See Also:
BigDecimal.toString
-
map
public JsBigDec map(java.util.function.UnaryOperator<java.math.BigDecimal> fn)
Maps this JsBigDec into another one- Parameters:
fn- the mapping function- Returns:
- a new JsBigDec
-
of
public static JsBigDec of(java.math.BigDecimal n)
Static factory method to create a JsBigDec from a BigDecimal object.- Parameters:
n- the big decimal- Returns:
- a new JsBigDec
-
test
public boolean test(java.util.function.Predicate<java.math.BigDecimal> predicate)
Tests the value of this json bigdec on a predicate- Parameters:
predicate- the predicate- Returns:
- true if this big decimal satisfies the predicate
-
-