Package com.libdbm.cel.ast
Record Class Call
java.lang.Object
java.lang.Record
com.libdbm.cel.ast.Call
- Record Components:
target- the optional receiver expression; may be null for global function callsfunction- the function or method nameargs- the argument expressions in call orderisMacro- whether this call represents a macro invocation that should be expanded during parsing rather than evaluated at runtime
- All Implemented Interfaces:
Expression
public record Call(Expression target, String function, List<Expression> args, boolean isMacro)
extends Record
implements Expression
Represents a function call or method invocation in CEL expressions.
Calls can be in either function style (fn(arg1, arg2)) or receiver/method style (receiver.fn(arg1, arg2)).
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.libdbm.cel.ast.Expression
Expression.Visitor<T> -
Constructor Summary
ConstructorsConstructorDescriptionCall(Expression target, String function, List<Expression> args) Constructs a function call or method invocation expression.Call(Expression target, String function, List<Expression> args, boolean isMacro) Creates an instance of aCallrecord class. -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(Expression.Visitor<T> visitor) Accepts a visitor and dispatches the visit operation to the appropriate visitor method.args()Returns the value of theargsrecord component.final booleanIndicates whether some other object is "equal to" this one.function()Returns the value of thefunctionrecord component.final inthashCode()Returns a hash code value for this object.booleanisMacro()Returns the value of theisMacrorecord component.target()Returns the value of thetargetrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Call
Constructs a function call or method invocation expression.This constructor creates a call expression with the specified target, function name, and arguments, marking it as a regular function call rather than a macro invocation.
- Parameters:
target- the optional receiver expression; may be null for global function callsfunction- the function or method nameargs- the argument expressions in call order
-
Call
Creates an instance of aCallrecord class.
-
-
Method Details
-
accept
Accepts a visitor and dispatches the visit operation to the appropriate visitor method.This method implements the visitor pattern for expression traversal, allowing external visitors to process call expressions in the abstract syntax tree.
- Specified by:
acceptin interfaceExpression- Type Parameters:
T- the return type of the visitor's visit operations- Parameters:
visitor- the visitor instance that will process this call expression- Returns:
- the result of the visitor's visitCall method, type T
-
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 '=='. -
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-
function
Returns the value of thefunctionrecord component.- Returns:
- the value of the
functionrecord component
-
args
Returns the value of theargsrecord component.- Returns:
- the value of the
argsrecord component
-
isMacro
public boolean isMacro()Returns the value of theisMacrorecord component.- Returns:
- the value of the
isMacrorecord component
-