Comparable<JsBigDec>
, JsElem
, JsNumber
public final class JsBigDec extends Object implements JsNumber, Comparable<JsBigDec>
Modifier and Type | Field | Description |
---|---|---|
BigDecimal |
x |
The big decimal value
|
Modifier and Type | Method | Description |
---|---|---|
int |
compareTo(JsBigDec o) |
Compares two
JsBigDec objects numerically |
boolean |
equals(@Nullable Object that) |
Indicates whether some other object is "equal to" this json big decimal.
|
int |
hashCode() |
Returns the hashcode of this json big decimal
|
JsBigDec |
map(UnaryOperator<BigDecimal> fn) |
Maps this JsBigDec into another one
|
static JsBigDec |
of(BigDecimal n) |
Static factory method to create a JsBigDec from a BigDecimal object.
|
boolean |
test(Predicate<BigDecimal> predicate) |
Tests the value of this json bigdec on a predicate
|
String |
toString() |
asJsArray, asJsBigDec, asJsBigInt, asJsBool, asJsDouble, asJsInt, asJsLong, asJsObj, asJson, asJsStr, isArray, isArray, isBigDec, isBigDec, isBigInt, isBigInt, isBool, isDouble, isDouble, isFalse, isInstant, isInstant, isInt, isInt, isIntegral, isJson, isJson, isLocalDate, isLocalDate, isLocalDateTime, isLocalDateTime, isLong, isLong, isNothing, isNotJson, isNotNothing, isNotNull, isNotNumber, isNull, isNumber, isObj, isObj, isStr, isStr, isTrue
public final BigDecimal x
public int compareTo(JsBigDec o)
JsBigDec
objects numericallycompareTo
in interface Comparable<JsBigDec>
compareTo(JsBigDec)
public boolean equals(@Nullable Object that)
JsBigDec.of(BigDecimal.valueOf(1.0)).equals(JsDouble.of(1.00))
JsBigDec.of(BigDecimal.valueOf(1.0)).equals(JsInt.of(1))
JsBigDec.of(BigDecimal.valueOf(1.0)).equals(JsBigInt.of(BigInteger.ONE))
JsBigDec.of(BigDecimal.valueOf(1.0)).equals(JsBigDec.of(BigDecimal.valueOf(1.00)))
JsBigDec.of(BigDecimal.valueOf(1.0)).equals(JsLong.of(1))
public int hashCode()
public JsBigDec map(UnaryOperator<BigDecimal> fn)
fn
- the mapping functionpublic boolean test(Predicate<BigDecimal> predicate)
predicate
- the predicatepublic static JsBigDec of(BigDecimal n)
n
- the big decimalpublic String toString()
toString
in class Object
BigDecimal.toString
Copyright © 2019. All rights reserved.