Class Time
- java.lang.Object
-
- org.opensearch.client.opensearch._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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTime.Builderstatic classTime.Kind
-
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<Time>_DESERIALIZER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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()booleanisOffset()Is this variant instance of kindoffset?booleanisTime()Is this variant instance of kindtime?static Timeof(java.util.function.Function<Time.Builder,ObjectBuilder<Time>> fn)java.lang.Integeroffset()Get theoffsetvariant value.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)java.lang.Stringtime()Get thetimevariant value.
-
-
-
Field Detail
-
_DESERIALIZER
public static final JsonpDeserializer<Time> _DESERIALIZER
-
-
Method Detail
-
_kind
public final Time.Kind _kind()
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<Time.Kind,java.lang.Object>- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()
- Specified by:
_getin interfaceTaggedUnion<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 kindoffset?
-
offset
public java.lang.Integer offset()
Get theoffsetvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theoffsetkind.
-
isTime
public boolean isTime()
Is this variant instance of kindtime?
-
time
public java.lang.String time()
Get thetimevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thetimekind.
-
serialize
public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)- Specified by:
serializein interfaceJsonpSerializable
-
-