Class Time
java.lang.Object
co.elastic.clients.elasticsearch._types.Time
- All Implemented Interfaces:
JsonpSerializable,TaggedUnion<Time.Kind,Object>
@JsonpDeserializable
public class Time
extends Object
implements TaggedUnion<Time.Kind,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:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal Object_get()final Time.Kind_kind()Get the of the kind of variant held by this object.booleanisOffset()Is this variant instance of kindoffset?booleanisTime()Is this variant instance of kindtime?static Timeof(Function<Time.Builder, ObjectBuilder<Time>> fn) offset()Get theoffsetvariant value.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) time()Get thetimevariant value.toString()
-
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<Time.Kind,Object> - Returns:
- the variant kind
-
_get
- Specified by:
_getin interfaceTaggedUnion<Time.Kind,Object>
-
_toJsonString
-
of
-
isOffset
public boolean isOffset()Is this variant instance of kindoffset? -
offset
Get theoffsetvariant value.- Throws:
IllegalStateException- if the current variant is not of theoffsetkind.
-
isTime
public boolean isTime()Is this variant instance of kindtime? -
time
Get thetimevariant value.- Throws:
IllegalStateException- if the current variant is not of thetimekind.
-
serialize
- Specified by:
serializein interfaceJsonpSerializable
-
toString
-