Enum Class UnaryOp

java.lang.Object
java.lang.Enum<UnaryOp>
com.libdbm.cel.ast.UnaryOp
All Implemented Interfaces:
Serializable, Comparable<UnaryOp>, Constable

public enum UnaryOp extends Enum<UnaryOp>
Enumeration representing unary operators supported in CEL expressions.

Unary operators are operations that take a single operand and produce a result. The supported operations include logical negation (NOT) and numeric negation (NEGATE).

  • Enum Constant Details

    • NOT

      public static final UnaryOp NOT
      Logical negation operator for boolean expressions.

      Represents the NOT unary operator that inverts the boolean value of its operand. When applied to a boolean expression, it returns true if the operand is false, and false if the operand is true.

    • NEGATE

      public static final UnaryOp NEGATE
      Represents the numeric negation unary operator in CEL expressions.

      This operator negates the numeric value of its operand, effectively changing its sign. For example, if the operand is 5, the result will be -5. If the operand is -3, the result will be 3.

      When used in an expression tree, this operator is represented by the NEGATE enum constant within the UnaryOp enumeration, which is part of the Unary record that encapsulates unary operations.

  • Method Details

    • values

      public static UnaryOp[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static UnaryOp valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null