java.lang.Object
jsonvalues.JsPrimitive
jsonvalues.JsNumber
jsonvalues.JsBigInt
- All Implemented Interfaces:
Comparable<JsBigInt>
,JsValue
Represents an immutable JSON number of type BigInteger.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final fun.optic.Prism<JsValue,
BigInteger> final BigInteger
the big integer value. -
Method Summary
Modifier and TypeMethodDescriptionint
Compares twoJsBigInt
objects numerically.boolean
Indicates whether some other object is "equal to" this JSON big integer.int
hashCode()
Returns the hashcode of this JSON big integer.boolean
isBigInt()
Returns true if this JsValue is a 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.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 Details
-
prism
-
value
the big integer value.
-
-
Method Details
-
of
Static factory method to create a JsBigInt from BigInteger objects.- Parameters:
n
- the big integer- Returns:
- a new JsBigInt
-
isBigInt
public boolean isBigInt()Description copied from interface:JsValue
Returns true if this JsValue is a JsBigInt. -
compareTo
Compares twoJsBigInt
objects numerically.- Specified by:
compareTo
in interfaceComparable<JsBigInt>
- See Also:
-
hashCode
public int hashCode()Returns the hashcode of this JSON big integer. -
equals
Indicates whether some other object is "equal to" this JSON big integer. Numbers of different types are equals if they have the same value. -
toString
-
map
Maps this JSON bigint into another one.- Parameters:
fn
- the mapping function- Returns:
- a new JsBigInt
-
test
Tests the value of this JSON bigint on a predicate.- Parameters:
predicate
- the predicate- Returns:
- true if this big integer satisfies the predicate
-