java.lang.Object
co.elastic.clients.elasticsearch._types.query_dsl.Like
All Implemented Interfaces:
JsonpSerializable, TaggedUnion<Like.Kind,​java.lang.Object>

@JsonpDeserializable
public class Like
extends java.lang.Object
implements TaggedUnion<Like.Kind,​java.lang.Object>, JsonpSerializable
Text that we want similar documents for or a lookup to a document's field for the text.
See Also:
Documentation on elastic.co, API specification
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  Like.Builder  
    static class  Like.Kind  
  • Field Summary

    Fields
    Modifier and Type Field Description
    static JsonpDeserializer<Like> _DESERIALIZER  
  • Method Summary

    Modifier and Type Method Description
    java.lang.Object _get()  
    Like.Kind _kind()
    Get the of the kind of variant held by this object.
    LikeDocument document()
    Get the document variant value.
    boolean isDocument()
    Is this variant instance of kind document?
    boolean isText()
    Is this variant instance of kind text?
    static Like of​(java.util.function.Function<Like.Builder,​ObjectBuilder<Like>> fn)  
    void serialize​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)  
    java.lang.String text()
    Get the text variant value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • _kind

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

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

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

      public boolean isDocument()
      Is this variant instance of kind document?
    • document

      public LikeDocument document()
      Get the document variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the document kind.
    • isText

      public boolean isText()
      Is this variant instance of kind text?
    • text

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

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