Package jsonvalues
Class JsBigDec
- java.lang.Object
-
- jsonvalues.JsNumber
-
- jsonvalues.JsBigDec
-
- All Implemented Interfaces:
Comparable<JsBigDec>,JsValue
public final class JsBigDec extends JsNumber implements Comparable<JsBigDec>
Represents an immutable json number of type BigDecimal.
-
-
Field Summary
Fields Modifier and Type Field Description static intIDBigDecimalvalueThe big decimal value
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(JsBigDec o)Compares twoJsBigDecobjects numericallybooleanequals(@Nullable 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(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 bigdec on a predicateStringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jsonvalues.JsValue
isArray, isArray, isBigDec, isBigInt, isBigInt, isBool, isDecimal, isDouble, isDouble, isFalse, isInstant, isInstant, isInt, isInt, isIntegral, isJson, isJson, isLocalDate, isLocalDate, isLocalDateTime, isLocalDateTime, isLong, isLong, isNothing, isNotJson, isNotNothing, isNotNull, isNotNumber, isNull, isObj, isObj, isSameType, isStr, isStr, isTrue, toJsArray, toJsBigDec, toJsBigInt, toJsBool, toJsDouble, toJsInt, toJsLong, toJsNumber, toJsObj, toJson, toJsStr
-
-
-
-
Field Detail
-
ID
public static final int ID
- See Also:
- Constant Field Values
-
value
public final BigDecimal value
The big decimal value
-
-
Method Detail
-
compareTo
public int compareTo(JsBigDec o)
Compares twoJsBigDecobjects numerically- Specified by:
compareToin interfaceComparable<JsBigDec>- See Also:
compareTo(JsBigDec)
-
equals
public boolean equals(@Nullable 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.
-
hashCode
public int hashCode()
Returns the hashcode of this json big decimal
-
map
public JsBigDec map(UnaryOperator<BigDecimal> fn)
Maps this JsBigDec into another one- Parameters:
fn- the mapping function- Returns:
- a new JsBigDec
-
test
public boolean test(Predicate<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
-
of
public static JsBigDec of(BigDecimal n)
Static factory method to create a JsBigDec from a BigDecimal object.- Parameters:
n- the big decimal- Returns:
- a new JsBigDec
-
toString
public String toString()
- Overrides:
toStringin classObject- Returns:
- a string representation of the bigdec value
- See Also:
BigDecimal.toString
-
-