Class Segment.Builder

java.lang.Object
org.opensearch.client.util.ObjectBuilderBase
org.opensearch.client.opensearch.indices.segments.Segment.Builder
All Implemented Interfaces:
CopyableBuilder<Segment.Builder,Segment>, MutableBuilder<Segment.Builder,Segment>, ObjectBuilder<Segment>
Enclosing class:
Segment

public static class Segment.Builder extends ObjectBuilderBase implements CopyableBuilder<Segment.Builder,Segment>
Builder for Segment.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • copy

      @Nonnull public Segment.Builder copy()
      Description copied from interface: CopyableBuilder
      Create a new builder CopyableBuilder that is a copy of this one.
      Specified by:
      copy in interface CopyableBuilder<Segment.Builder,Segment>
      Returns:
      a new builder instance.
    • attributes

      @Nonnull public final Segment.Builder attributes(Map<String,String> map)
      Required - The attributes of the segment.

      API name: attributes

      Adds all elements of map to attributes.

    • attributes

      @Nonnull public final Segment.Builder attributes(String key, String value)
      Required - The attributes of the segment.

      API name: attributes

      Adds an entry to attributes.

    • committed

      @Nonnull public final Segment.Builder committed(boolean value)
      Required - Whether the segment is committed.

      API name: committed

    • compound

      @Nonnull public final Segment.Builder compound(boolean value)
      Required - Whether the segment is compound.

      API name: compound

    • deletedDocs

      @Nonnull public final Segment.Builder deletedDocs(int value)
      Required - The number of deleted documents in the segment.

      API name: deleted_docs

    • generation

      @Nonnull public final Segment.Builder generation(int value)
      Required - The generation number of the segment.

      API name: generation

    • memory

      @Nonnull public final Segment.Builder memory(@Nullable String value)
      API name: memory
    • memoryInBytes

      @Nonnull public final Segment.Builder memoryInBytes(@Nullable Long value)
      API name: memory_in_bytes
    • numDocs

      @Nonnull public final Segment.Builder numDocs(int value)
      Required - The number of documents in the segment.

      API name: num_docs

    • search

      @Nonnull public final Segment.Builder search(boolean value)
      Required - Whether the segment is searchable.

      API name: search

    • size

      @Nonnull public final Segment.Builder size(@Nullable String value)
      API name: size
    • sizeInBytes

      @Nonnull public final Segment.Builder sizeInBytes(long value)
      Required - API name: size_in_bytes
    • version

      @Nonnull public final Segment.Builder version(String value)
      Required - API name: version
    • build

      @Nonnull public Segment build()
      Builds a Segment.
      Specified by:
      build in interface ObjectBuilder<Segment>
      Throws:
      NullPointerException - if some of the required fields are null.