Package jsonvalues
Class JsLong
- java.lang.Object
-
- jsonvalues.JsNumber
-
- jsonvalues.JsLong
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(JsLong o)Compares twoJsLongobjects numerically.booleanequals(java.lang.Object that)Indicates whether some other object is "equal to" this json long.inthashCode()Returns the hashcode of this json long.intid()booleanisLong()JsLongmap(java.util.function.LongUnaryOperator fn)Maps this json long into another one.static JsLongof(long n)Static factory method to create a JsLong from a long primitive type.booleantest(java.util.function.LongPredicate predicate)Tests the value of this json long on a predicate.java.lang.StringtoString()-
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, isBigInt, isBinary, isBool, isDecimal, isDouble, isDouble, isFalse, isInstant, isInstant, isInt, isInt, isIntegral, isJson, isJson, isLong, isNothing, isNotJson, 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
-
ID
public static final int ID
- See Also:
- Constant Field Values
-
prism
public static Prism<JsValue,java.lang.Long> prism
prism between the sum type JsValue and JsLong
-
value
public final long value
The long primitive.
-
-
Method Detail
-
isLong
public boolean isLong()
-
compareTo
public int compareTo(JsLong o)
Compares twoJsLongobjects numerically.- Specified by:
compareToin interfacejava.lang.Comparable<JsLong>- See Also:
Long.compareTo(Long)
-
hashCode
public int hashCode()
Returns the hashcode of this json long.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashcode of this JsLong
-
equals
public boolean equals(java.lang.Object that)
Indicates whether some other object is "equal to" this json long. Numbers of different types are equals if the have the same value.- Overrides:
equalsin 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 JsLong
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of the long value.
- See Also:
Long.toString
-
map
public JsLong map(java.util.function.LongUnaryOperator fn)
Maps this json long into another one.- Parameters:
fn- the mapping function- Returns:
- a new JsLong
-
of
public static JsLong of(long n)
Static factory method to create a JsLong from a long primitive type.- Parameters:
n- the long primitive type- Returns:
- a new JsLong
-
test
public boolean test(java.util.function.LongPredicate predicate)
Tests the value of this json long on a predicate.- Parameters:
predicate- the predicate- Returns:
- true if this long satisfies the predicate
-
-