Class IsNull

java.lang.Object
dev.vortex.api.expressions.IsNull
All Implemented Interfaces:
Expression

public final class IsNull extends Object implements Expression
Represents an IS NULL expression that checks whether values are null. This expression returns true for null values and false for non-null values.
  • Method Details

    • parse

      public static IsNull parse(byte[] metadata, List<Expression> children)
      Parses an IsNull expression from serialized metadata and child expressions. This method is used during deserialization of Vortex expressions.
      Parameters:
      metadata - the serialized metadata, must be empty for IsNull expressions
      children - the child expressions, must contain exactly one element
      Returns:
      a new IsNull expression parsed from the provided data
      Throws:
      IllegalArgumentException - if the number of children is not exactly one, or if metadata is not empty
    • of

      public static IsNull of(Expression child)
      Creates a new IsNull expression that checks nullity of the given child expression.
      Parameters:
      child - the expression to check for null values
      Returns:
      a new IsNull expression
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • id

      public String id()
      Description copied from interface: Expression
      The globally unique identifier for this type of expression.
      Specified by:
      id in interface Expression
    • children

      public List<Expression> children()
      Description copied from interface: Expression
      Returns the children of this expression.
      Specified by:
      children in interface Expression
    • metadata

      public Optional<byte[]> metadata()
      Description copied from interface: Expression
      Returns the serialized metadata for this expression, or empty if serialization is not supported.
      Specified by:
      metadata in interface Expression
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getChild

      public Expression getChild()
      Returns the child expression that will be checked for null values.
      Returns:
      the child expression
    • accept

      public <T> T accept(Expression.Visitor<T> visitor)
      Description copied from interface: Expression
      Accepts a visitor and dispatches to the appropriate visit method based on the expression type. This method implements the visitor pattern, allowing different operations to be performed on expressions without modifying the expression classes themselves.
      Specified by:
      accept in interface Expression
      Type Parameters:
      T - the return type of the visitor
      Parameters:
      visitor - the visitor to accept
      Returns:
      the result of the visitor's operation on this expression