Package dev.vortex.api.expressions
Class IsNotNull
java.lang.Object
dev.vortex.api.expressions.IsNotNull
- All Implemented Interfaces:
Expression
Represents an IS NOT NULL expression that checks whether values are non-null.
This expression returns true for non-null values and false for null values.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.vortex.api.Expression
Expression.Visitor<T> -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(Expression.Visitor<T> visitor) Accepts a visitor and dispatches to the appropriate visit method based on the expression type.children()Returns the children of this expression.booleangetChild()Returns the child expression that will be checked for non-null values.inthashCode()id()The globally unique identifier for this type of expression.Optional<byte[]>metadata()Returns the serialized metadata for this expression, or empty if serialization is not supported.static IsNotNullof(Expression child) Creates a new IsNotNull expression that checks non-nullity of the given child expression.static IsNotNullparse(byte[] metadata, List<Expression> children) Parses an IsNotNull expression from serialized metadata and child expressions.toString()
-
Method Details
-
parse
Parses an IsNotNull 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 IsNotNull expressionschildren- the child expressions, must contain exactly one element- Returns:
- a new IsNotNull expression parsed from the provided data
- Throws:
IllegalArgumentException- if the number of children is not exactly one, or if metadata is not empty
-
of
Creates a new IsNotNull expression that checks non-nullity of the given child expression.- Parameters:
child- the expression to check for non-null values- Returns:
- a new IsNotNull expression
-
equals
-
hashCode
public int hashCode() -
id
Description copied from interface:ExpressionThe globally unique identifier for this type of expression.- Specified by:
idin interfaceExpression
-
children
Description copied from interface:ExpressionReturns the children of this expression.- Specified by:
childrenin interfaceExpression
-
metadata
Description copied from interface:ExpressionReturns the serialized metadata for this expression, or empty if serialization is not supported.- Specified by:
metadatain interfaceExpression
-
toString
-
getChild
Returns the child expression that will be checked for non-null values.- Returns:
- the child expression
-
accept
Description copied from interface:ExpressionAccepts 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:
acceptin interfaceExpression- 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
-