Class Condition

java.lang.Object
co.elastic.clients.elasticsearch.watcher.Condition
All Implemented Interfaces:
JsonpSerializable, TaggedUnion<Condition.Kind,​java.lang.Object>

@JsonpDeserializable
public class Condition
extends java.lang.Object
implements TaggedUnion<Condition.Kind,​java.lang.Object>, JsonpSerializable
See Also:
API specification
  • Field Details

  • Constructor Details

  • Method Details

    • _kind

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

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

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

      public boolean isAlways()
      Is this variant instance of kind always?
    • always

      public AlwaysCondition always()
      Get the always variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the always kind.
    • isArrayCompare

      public boolean isArrayCompare()
      Is this variant instance of kind array_compare?
    • arrayCompare

      public ArrayCompareCondition arrayCompare()
      Get the array_compare variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the array_compare kind.
    • isCompare

      public boolean isCompare()
      Is this variant instance of kind compare?
    • compare

      public CompareCondition compare()
      Get the compare variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the compare kind.
    • isNever

      public boolean isNever()
      Is this variant instance of kind never?
    • never

      public NeverCondition never()
      Get the never variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the never kind.
    • isScript

      public boolean isScript()
      Is this variant instance of kind script?
    • script

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

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

      protected static void setupConditionDeserializer​(ObjectDeserializer<Condition.Builder> op)