Package jsonvalues
Class JsBigInt
- java.lang.Object
-
- jsonvalues.JsPrimitive
-
- jsonvalues.JsNumber
-
- jsonvalues.JsBigInt
-
-
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(java.lang.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(java.util.function.UnaryOperator<java.math.BigInteger> fn)
Maps this json bigint into another one.static JsBigInt
of(java.math.BigInteger n)
Static factory method to create a JsBigInt from BigInteger objects.boolean
test(java.util.function.Predicate<java.math.BigInteger> predicate)
Tests the value of this json bigint on a predicate.java.lang.String
toString()
-
Methods inherited from class jsonvalues.JsNumber
isNumber, toJsPrimitive
-
Methods inherited from class jsonvalues.JsPrimitive
isJson, isPrimitive
-
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, 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 Detail
-
TYPE_ID
public static final int TYPE_ID
- See Also:
- Constant Field Values
-
value
public final java.math.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 interfacejava.lang.Comparable<JsBigInt>
- See Also:
compareTo(JsBigInt)
-
hashCode
public int hashCode()
Returns the hashcode of this json big integer.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- the hashcode of this JsBigInt
-
equals
public boolean equals(java.lang.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.- Overrides:
equals
in 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:
toString
in classjava.lang.Object
- Returns:
- a string representation of the bigint value.
- See Also:
BigInteger.toString
-
map
public JsBigInt map(java.util.function.UnaryOperator<java.math.BigInteger> fn)
Maps this json bigint into another one.- Parameters:
fn
- the mapping function- Returns:
- a new JsBigInt
-
of
public static JsBigInt of(java.math.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(java.util.function.Predicate<java.math.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
-
-