Class Buckets<TBucket>
- java.lang.Object
-
- org.opensearch.client.opensearch._types.aggregations.Buckets<TBucket>
-
- All Implemented Interfaces:
JsonpSerializable,TaggedUnion<Buckets.Kind,java.lang.Object>
public class Buckets<TBucket> extends java.lang.Object implements TaggedUnion<Buckets.Kind,java.lang.Object>, JsonpSerializable
Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for the different buckets, the result is a dictionary.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBuckets.Builder<TBucket>static classBuckets.Kind
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object_get()Buckets.Kind_kind()Get the of the kind of variant held by this object.java.util.List<TBucket>array()Get thearrayvariant value.static <TBucket> JsonpDeserializer<Buckets<TBucket>>createBucketsDeserializer(JsonpDeserializer<TBucket> tBucketDeserializer)booleanisArray()Is this variant instance of kindarray?booleanisKeyed()Is this variant instance of kindkeyed?java.util.Map<java.lang.String,TBucket>keyed()Get thekeyedvariant value.static <TBucket> Buckets<TBucket>of(java.util.function.Function<Buckets.Builder<TBucket>,ObjectBuilder<Buckets<TBucket>>> fn)voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
-
-
-
Method Detail
-
_kind
public final Buckets.Kind _kind()
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<Buckets.Kind,java.lang.Object>- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()
- Specified by:
_getin interfaceTaggedUnion<Buckets.Kind,java.lang.Object>
-
of
public static <TBucket> Buckets<TBucket> of(java.util.function.Function<Buckets.Builder<TBucket>,ObjectBuilder<Buckets<TBucket>>> fn)
-
isArray
public boolean isArray()
Is this variant instance of kindarray?
-
array
public java.util.List<TBucket> array()
Get thearrayvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thearraykind.
-
isKeyed
public boolean isKeyed()
Is this variant instance of kindkeyed?
-
keyed
public java.util.Map<java.lang.String,TBucket> keyed()
Get thekeyedvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thekeyedkind.
-
serialize
public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)- Specified by:
serializein interfaceJsonpSerializable
-
createBucketsDeserializer
public static <TBucket> JsonpDeserializer<Buckets<TBucket>> createBucketsDeserializer(JsonpDeserializer<TBucket> tBucketDeserializer)
-
-