Package jsonvalues
Class JsInstant
- java.lang.Object
-
- jsonvalues.JsInstant
-
public class JsInstant extends java.lang.Object implements JsValue, 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 intcompareTo(JsInstant o)booleanequals(java.lang.Object o)inthashCode()intid()booleanisInstant()static JsInstantof(java.time.Instant instant)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, isInt, isInt, isIntegral, isJson, isJson, isLong, isLong, isNothing, isNotJson, 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
-
ID
public static final int ID
- See Also:
- Constant Field Values
-
value
public final java.time.Instant value
-
-
Method Detail
-
of
public static JsInstant of(java.time.Instant instant)
-
isInstant
public boolean isInstant()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-