Package jsonvalues
Class JsLong
- java.lang.Object
-
- jsonvalues.JsNumber
-
- jsonvalues.JsLong
-
- All Implemented Interfaces:
Comparable<JsLong>
,JsValue
public final class JsLong extends JsNumber implements Comparable<JsLong>
Represents an immutable json number of type long.
-
-
Field Summary
Fields Modifier and Type Field Description long
value
The long primitive.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(JsLong o)
Compares twoJsLong
objects numerically.boolean
equals(@Nullable Object that)
Indicates whether some other object is "equal to" this json long.int
hashCode()
Returns the hashcode of this json long.int
id()
boolean
isLong()
JsLong
map(LongUnaryOperator fn)
Maps this json long into another one.static JsLong
of(long n)
Static factory method to create a JsLong from a long primitive type.boolean
test(LongPredicate predicate)
Tests the value of this json long on a predicate.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jsonvalues.JsValue
isArray, isArray, isBigDec, isBigDec, isBigInt, isBigInt, isBool, isDecimal, isDouble, isDouble, isFalse, isInstant, isInstant, isInt, isInt, isIntegral, isJson, isJson, isLocalDate, isLocalDate, isLocalDateTime, isLocalDateTime, isLong, isNothing, isNotJson, isNotNothing, isNotNull, isNotNumber, isNull, isObj, isObj, isSameType, isStr, isStr, isTrue, toJsArray, toJsBigDec, toJsBigInt, toJsBool, toJsDouble, toJsInt, toJsLong, toJsNumber, toJsObj, toJson, toJsStr
-
-
-
-
Method Detail
-
compareTo
public int compareTo(JsLong o)
Compares twoJsLong
objects numerically.- Specified by:
compareTo
in interfaceComparable<JsLong>
- See Also:
Long.compareTo(Long)
-
equals
public boolean equals(@Nullable 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.
-
hashCode
public int hashCode()
Returns the hashcode of this json long.
-
map
public JsLong map(LongUnaryOperator fn)
Maps this json long into another one.- Parameters:
fn
- the mapping function- Returns:
- a new JsLong
-
test
public boolean test(LongPredicate predicate)
Tests the value of this json long on a predicate.- Parameters:
predicate
- the predicate- Returns:
- true if this long satisfies the predicate
-
toString
public String toString()
- Overrides:
toString
in classObject
- Returns:
- a string representation of the long value.
- See Also:
Long.toString
-
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
-
-