Package jsonvalues
Class JsLong
java.lang.Object
jsonvalues.JsPrimitive
jsonvalues.JsNumber
jsonvalues.JsLong
- All Implemented Interfaces:
Comparable<JsLong>,JsValue
Represents an immutable JSON number of type long.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintCompares twoJsLongobjects numerically.booleanIndicates whether some other object is "equal to" this JSON long.inthashCode()Returns the hashcode of this JSON long.booleanisLong()Returns this JsValue as a JsLong.map(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(LongPredicate predicate) Tests the value of this JSON long on a predicate.toString()Methods inherited from class jsonvalues.JsNumber
isNumber, toJsPrimitiveMethods inherited from class jsonvalues.JsPrimitive
isJson, isPrimitiveMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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, 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
prism between the sum type JsValue and JsLong -
value
public final long valueThe long primitive.
-
-
Method Details
-
of
Static factory method to create a JsLong from a long primitive type.- Parameters:
n- the long primitive type- Returns:
- a new JsLong
-
isLong
public boolean isLong()Description copied from interface:JsValueReturns this JsValue as a JsLong. -
compareTo
Compares twoJsLongobjects numerically.- Specified by:
compareToin interfaceComparable<JsLong>- See Also:
-
hashCode
public int hashCode()Returns the hashcode of this JSON long. -
equals
Indicates whether some other object is "equal to" this JSON long. Numbers of different types are equals if they have the same value. -
toString
-
map
Maps this JSON long into another one.- Parameters:
fn- the mapping function- Returns:
- a new JsLong
-
test
Tests the value of this JSON long on a predicate.- Parameters:
predicate- the predicate- Returns:
- true if this long satisfies the predicate
-