Class SourceConfig

java.lang.Object
co.elastic.clients.elasticsearch.core.search.SourceConfig
All Implemented Interfaces:
JsonpSerializable, TaggedUnion<SourceConfig.Kind,​java.lang.Object>

@JsonpDeserializable
public class SourceConfig
extends java.lang.Object
implements TaggedUnion<SourceConfig.Kind,​java.lang.Object>, JsonpSerializable
Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.
See Also:
API specification
  • Field Details

  • Method Details

    • _kind

      public final SourceConfig.Kind _kind()
      Description copied from interface: TaggedUnion
      Get the of the kind of variant held by this object.
      Specified by:
      _kind in interface TaggedUnion<SourceConfig.Kind,​java.lang.Object>
      Returns:
      the variant kind
    • _get

      public final java.lang.Object _get()
      Specified by:
      _get in interface TaggedUnion<SourceConfig.Kind,​java.lang.Object>
    • of

      public static SourceConfig of​(java.util.function.Function<SourceConfig.Builder,​ObjectBuilder<SourceConfig>> fn)
    • isFilter

      public boolean isFilter()
      Is this variant instance of kind filter?
    • filter

      public SourceFilter filter()
      Get the filter variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the filter kind.
    • isFetch

      public boolean isFetch()
      Is this variant instance of kind fetch?
    • fetch

      public java.lang.Boolean fetch()
      Get the fetch variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the fetch kind.
    • serialize

      public void serialize​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Specified by:
      serialize in interface JsonpSerializable