Package jsonvalues
Class JsBigInt
- java.lang.Object
-
- jsonvalues.JsPrimitive
-
- 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 fun.optic.Prism<JsValue,BigInteger>prismstatic intTYPE_IDBigIntegervaluethe big integer value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(JsBigInt o)Compares twoJsBigIntobjects numerically.booleanequals(Object that)Indicates whether some other object is "equal to" this json big integer.inthashCode()Returns the hashcode of this json big integer.intid()booleanisBigInt()Returns true if this JsValue is a JsBigIntJsBigIntmap(UnaryOperator<BigInteger> fn)Maps this json bigint into another one.static JsBigIntof(BigInteger n)Static factory method to create a JsBigInt from BigInteger objects.booleantest(Predicate<BigInteger> predicate)Tests the value of this json bigint on a predicate.StringtoString()-
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
-
prism
public static final fun.optic.Prism<JsValue,BigInteger> prism
-
value
public final BigInteger value
the big integer value.
-
-
Method Detail
-
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
-
isBigInt
public boolean isBigInt()
Description copied from interface:JsValueReturns true if this JsValue is a JsBigInt
-
compareTo
public int compareTo(JsBigInt o)
Compares twoJsBigIntobjects numerically.- Specified by:
compareToin 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 they have the same value.
-
toString
public String toString()
- Overrides:
toStringin 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
-
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
-
-