Package com.libdbm.cel.ast
Record Class Select
java.lang.Object
java.lang.Record
com.libdbm.cel.ast.Select
- Record Components:
operand- the expression whose field is being selectedfield- the field name to selectisTest- whether this represents a presence test rather than a value fetch
- All Implemented Interfaces:
Expression
public record Select(Expression operand, String field, boolean isTest)
extends Record
implements Expression
Represents field selection in CEL expressions.
Selection can be used for field access (operand.field). When isTest is true, the
expression is a presence test (has(operand.field)).
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.libdbm.cel.ast.Expression
Expression.Visitor<T> -
Constructor Summary
ConstructorsConstructorDescriptionSelect(Expression operand, String field) Constructs a field selection expression.Select(Expression operand, String field, boolean isTest) Creates an instance of aSelectrecord class. -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(Expression.Visitor<T> visitor) Accepts a visitor and dispatches the visit to the appropriate method based on the expression type.final booleanIndicates whether some other object is "equal to" this one.field()Returns the value of thefieldrecord component.final inthashCode()Returns a hash code value for this object.booleanisTest()Returns the value of theisTestrecord component.operand()Returns the value of theoperandrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Select
Constructs a field selection expression.Represents a field access operation (operand.field) in CEL expressions. When
isTestis true, the expression represents a presence test (has(operand.field)) rather than a value fetch.- Parameters:
operand- the expression whose field is being selectedfield- the field name to select
-
Select
Creates an instance of aSelectrecord class.
-
-
Method Details
-
accept
Accepts a visitor and dispatches the visit to the appropriate method based on the expression type.This method implements the visitor pattern by calling the visitSelect method on the provided visitor, passing this Select expression instance to it.
- Specified by:
acceptin interfaceExpression- Type Parameters:
T- the return type of the visitor's visit operations- Parameters:
visitor- the visitor that will process this select expression- Returns:
- the result of the visitor's visitSelect method
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
operand
Returns the value of theoperandrecord component.- Returns:
- the value of the
operandrecord component
-
field
Returns the value of thefieldrecord component.- Returns:
- the value of the
fieldrecord component
-
isTest
public boolean isTest()Returns the value of theisTestrecord component.- Returns:
- the value of the
isTestrecord component
-