java.lang.Object
co.elastic.clients.elasticsearch._types.Time
All Implemented Interfaces:
JsonpSerializable, TaggedUnion<Time.Kind,​java.lang.Object>

@JsonpDeserializable
public class Time
extends java.lang.Object
implements TaggedUnion<Time.Kind,​java.lang.Object>, JsonpSerializable
Whenever durations need to be specified, e.g. for a timeout parameter, the duration must specify the unit, like 2d for 2 days.
See Also:
Documentation on elastic.co, API specification
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  Time.Builder  
    static class  Time.Kind  
  • Field Summary

    Fields
    Modifier and Type Field Description
    static JsonpDeserializer<Time> _DESERIALIZER  
  • Method Summary

    Modifier and Type Method Description
    java.lang.Object _get()  
    Time.Kind _kind()
    Get the of the kind of variant held by this object.
    java.lang.String _toJsonString()  
    boolean isOffset()
    Is this variant instance of kind offset?
    boolean isTime()
    Is this variant instance of kind time?
    static Time of​(java.util.function.Function<Time.Builder,​ObjectBuilder<Time>> fn)  
    java.lang.Integer offset()
    Get the offset variant value.
    void serialize​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)  
    java.lang.String time()
    Get the time variant value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • _kind

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

      public final java.lang.Object _get()
      Specified by:
      _get in interface TaggedUnion<Time.Kind,​java.lang.Object>
    • _toJsonString

      public java.lang.String _toJsonString()
    • of

      public static Time of​(java.util.function.Function<Time.Builder,​ObjectBuilder<Time>> fn)
    • isOffset

      public boolean isOffset()
      Is this variant instance of kind offset?
    • offset

      public java.lang.Integer offset()
      Get the offset variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the offset kind.
    • isTime

      public boolean isTime()
      Is this variant instance of kind time?
    • time

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

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