Class IndexTemplate.Builder

All Implemented Interfaces:
WithJson<IndexTemplate.Builder>, ObjectBuilder<IndexTemplate>
Enclosing class:
IndexTemplate

public static class IndexTemplate.Builder extends WithJsonObjectBuilderBase<IndexTemplate.Builder> implements ObjectBuilder<IndexTemplate>
Builder for IndexTemplate.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • indexPatterns

      public final IndexTemplate.Builder indexPatterns(List<String> list)
      Required - Name of the index template.

      API name: index_patterns

      Adds all elements of list to indexPatterns.

    • indexPatterns

      public final IndexTemplate.Builder indexPatterns(String value, String... values)
      Required - Name of the index template.

      API name: index_patterns

      Adds one or more values to indexPatterns.

    • composedOf

      public final IndexTemplate.Builder composedOf(List<String> list)
      Required - An ordered list of component template names. Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence.

      API name: composed_of

      Adds all elements of list to composedOf.

    • composedOf

      public final IndexTemplate.Builder composedOf(String value, String... values)
      Required - An ordered list of component template names. Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence.

      API name: composed_of

      Adds one or more values to composedOf.

    • template

      public final IndexTemplate.Builder template(@Nullable IndexTemplateSummary value)
      Template to be applied. It may optionally include an aliases, mappings, or settings configuration.

      API name: template

    • template

      Template to be applied. It may optionally include an aliases, mappings, or settings configuration.

      API name: template

    • version

      public final IndexTemplate.Builder version(@Nullable Long value)
      Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch.

      API name: version

    • priority

      public final IndexTemplate.Builder priority(@Nullable Long value)
      Priority to determine index template precedence when a new data stream or index is created. The index template with the highest priority is chosen. If no priority is specified the template is treated as though it is of priority 0 (lowest priority). This number is not automatically generated by Elasticsearch.

      API name: priority

    • meta

      public final IndexTemplate.Builder meta(Map<String,JsonData> map)
      Optional user metadata about the index template. May have any contents. This map is not automatically generated by Elasticsearch.

      API name: _meta

      Adds all entries of map to meta.

    • meta

      public final IndexTemplate.Builder meta(String key, JsonData value)
      Optional user metadata about the index template. May have any contents. This map is not automatically generated by Elasticsearch.

      API name: _meta

      Adds an entry to meta.

    • allowAutoCreate

      public final IndexTemplate.Builder allowAutoCreate(@Nullable Boolean value)
      API name: allow_auto_create
    • dataStream

      public final IndexTemplate.Builder dataStream(@Nullable IndexTemplateDataStreamConfiguration value)
      If this object is included, the template is used to create data streams and their backing indices. Supports an empty object. Data streams require a matching index template with a data_stream object.

      API name: data_stream

    • dataStream

      If this object is included, the template is used to create data streams and their backing indices. Supports an empty object. Data streams require a matching index template with a data_stream object.

      API name: data_stream

    • self

      protected IndexTemplate.Builder self()
      Specified by:
      self in class WithJsonObjectBuilderBase<IndexTemplate.Builder>
    • build

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