Package jsonvalues
Class JsBigInt
- java.lang.Object
-
- jsonvalues.JsNumber
-
- jsonvalues.JsBigInt
-
- All Implemented Interfaces:
Comparable<JsBigInt>
,JsValue
public final class JsBigInt extends JsNumber implements Comparable<JsBigInt>
Represents an immutable json number of type BigInteger.
-
-
Field Summary
Fields Modifier and Type Field Description static int
ID
static Prism<JsValue,BigInteger>
prism
BigInteger
value
the big integer value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(JsBigInt o)
Compares twoJsBigInt
objects numerically.boolean
equals(Object that)
Indicates whether some other object is "equal to" this json big integer.int
hashCode()
Returns the hashcode of this json big integer.int
id()
boolean
isBigInt()
JsBigInt
map(UnaryOperator<BigInteger> fn)
Maps this json bigint into another one.static JsBigInt
of(BigInteger n)
Static factory method to create a JsBigInt from BigInteger objects.boolean
test(Predicate<BigInteger> predicate)
Tests the value of this json bigint on a predicate.String
toString()
-
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, isBigDec, 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
-
prism
public static Prism<JsValue,BigInteger> prism
-
value
public final BigInteger value
the big integer value.
-
-
Method Detail
-
isBigInt
public boolean isBigInt()
-
compareTo
public int compareTo(JsBigInt o)
Compares twoJsBigInt
objects numerically.- Specified by:
compareTo
in interfaceComparable<JsBigInt>
- See Also:
compareTo(JsBigInt)
-
hashCode
public int hashCode()
Returns the hashcode of this json big integer.
-
equals
public boolean equals(Object that)
Indicates whether some other object is "equal to" this json big integer. Numbers of different types are equals if the have the same value.
-
toString
public String toString()
- Overrides:
toString
in classObject
- Returns:
- a string representation of the bigint value.
- See Also:
BigInteger.toString
-
map
public JsBigInt map(UnaryOperator<BigInteger> fn)
Maps this json bigint into another one.- Parameters:
fn
- the mapping function- Returns:
- a new JsBigInt
-
of
public static JsBigInt of(BigInteger n)
Static factory method to create a JsBigInt from BigInteger objects.- Parameters:
n
- the big integer- Returns:
- a new JsBigInt
-
test
public boolean test(Predicate<BigInteger> predicate)
Tests the value of this json bigint on a predicate.- Parameters:
predicate
- the predicate- Returns:
- true if this big integer satisfies the predicate
-
-