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
  • Field Details

  • Method Details

    • _kind

      public final DateOrEpochMillis.Kind _kind()
      Description copied from interface: TaggedUnion
      Get the of the kind of variant held by this object.
      Specified by:
      _kind in interface TaggedUnion<DateOrEpochMillis.Kind,​java.lang.Object>
      Returns:
      the variant kind
    • _get

      public final java.lang.Object _get()
      Specified by:
      _get in interface TaggedUnion<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 kind date?
    • date

      public java.lang.String date()
      Get the date variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the date kind.
    • isMillis

      public boolean isMillis()
      Is this variant instance of kind millis?
    • millis

      public java.lang.Long millis()
      Get the millis variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the millis kind.
    • serialize

      public void serialize​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Specified by:
      serialize in interface JsonpSerializable