Package jsonvalues
Class JsInstant
- java.lang.Object
-
- jsonvalues.JsPrimitive
-
- jsonvalues.JsInstant
-
public class JsInstant extends JsPrimitive implements java.lang.Comparable<JsInstant>
Represents an immutable instant. An instant is not part of the Json specification. It it serialized into its a string representation using ISO-8601 representation. A JsInstant and a JsStr are equals if both represent the same date.Instant a = Instant.now(); JsStr.of(a.toString()).equals(JsIntant.of(a)) // true
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(JsInstant o)
boolean
equals(java.lang.Object o)
int
hashCode()
int
id()
boolean
isInstant()
static JsInstant
of(java.time.Instant instant)
JsPrimitive
toJsPrimitive()
java.lang.String
toString()
-
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, isBigInt, isBinary, isBool, isDecimal, isDouble, isDouble, isFalse, isInstant, isInt, isInt, isIntegral, isJson, isLong, isLong, isNothing, isNotNothing, isNotNull, isNotNumber, isNull, isNumber, 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
-
value
public final java.time.Instant value
-
-
Method Detail
-
of
public static JsInstant of(java.time.Instant instant)
-
toJsPrimitive
public JsPrimitive toJsPrimitive()
- Specified by:
toJsPrimitive
in interfaceJsValue
-
isInstant
public boolean isInstant()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-