public final class JsInt extends JsNumber implements Comparable<JsInt>
Modifier and Type | Field and Description |
---|---|
static fun.optic.Prism<JsValue,Integer> |
prism
prism between the sum type JsValue and JsInt
|
static int |
TYPE_ID |
int |
value
The integer value.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(JsInt o)
Compares two
JsInt objects numerically. |
boolean |
equals(Object that)
Indicates whether some other object is "equal to" this json integer.
|
int |
hashCode()
Returns the hashcode of this json integer.
|
int |
id() |
boolean |
isInt()
Returns true if this JsValue is a JsInt
|
JsInt |
map(IntUnaryOperator fn)
Maps this json integer into another one.
|
static JsInt |
of(int n)
Static factory method to create a JsInt from an integer primitive type.
|
boolean |
test(IntPredicate predicate)
/**
Tests the value of this json integer on a predicate.
|
String |
toString() |
isNumber, toJsPrimitive
isJson, isPrimitive
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
ifNothing, ifNull, isArray, isArray, isBigDec, isBigDec, isBigInt, isBigInt, isBinary, isBool, isDecimal, isDouble, isDouble, isFalse, isInstant, isInstant, 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
public static final fun.optic.Prism<JsValue,Integer> prism
public static final int TYPE_ID
public final int value
public static JsInt of(int n)
n
- the integer primitive typepublic boolean isInt()
JsValue
public int compareTo(JsInt o)
JsInt
objects numerically.compareTo
in interface Comparable<JsInt>
Integer.compareTo(Integer)
public int hashCode()
public boolean equals(Object that)
public String toString()
toString
in class Object
Integer.toString
public JsInt map(IntUnaryOperator fn)
fn
- the mapping functionpublic boolean test(IntPredicate predicate)
predicate
- the predicateCopyright © 2022. All rights reserved.