Class DateOrEpochMillis
java.lang.Object
co.elastic.clients.elasticsearch._types.DateOrEpochMillis
- All Implemented Interfaces:
JsonpSerializable,TaggedUnion<DateOrEpochMillis.Kind,java.lang.Object>
@JsonpDeserializable public class DateOrEpochMillis extends java.lang.Object implements TaggedUnion<DateOrEpochMillis.Kind,java.lang.Object>, JsonpSerializable
- See Also:
- API specification
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDateOrEpochMillis.Builderstatic classDateOrEpochMillis.Kind -
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<DateOrEpochMillis>_DESERIALIZER -
Method Summary
Modifier and Type Method Description java.lang.Object_get()DateOrEpochMillis.Kind_kind()Get the of the kind of variant held by this object.java.lang.String_toJsonString()java.lang.Stringdate()Get thedatevariant value.booleanisDate()Is this variant instance of kinddate?booleanisMillis()Is this variant instance of kindmillis?java.lang.Longmillis()Get themillisvariant value.static DateOrEpochMillisof(java.util.function.Function<DateOrEpochMillis.Builder,ObjectBuilder<DateOrEpochMillis>> fn)voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
_DESERIALIZER
-
-
Method Details
-
_kind
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<DateOrEpochMillis.Kind,java.lang.Object>- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()- Specified by:
_getin interfaceTaggedUnion<DateOrEpochMillis.Kind,java.lang.Object>
-
_toJsonString
public java.lang.String _toJsonString() -
of
public static DateOrEpochMillis of(java.util.function.Function<DateOrEpochMillis.Builder,ObjectBuilder<DateOrEpochMillis>> fn) -
isDate
public boolean isDate()Is this variant instance of kinddate? -
date
public java.lang.String date()Get thedatevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thedatekind.
-
isMillis
public boolean isMillis()Is this variant instance of kindmillis? -
millis
public java.lang.Long millis()Get themillisvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of themilliskind.
-
serialize
- Specified by:
serializein interfaceJsonpSerializable
-