Record Class CelToken
java.lang.Object
java.lang.Record
org.impulsegraph.compiler.cel.CelToken
public record CelToken(CelTokenType type, String text, long intVal, double floatVal, boolean boolVal, int pos)
extends Record
Immutable token record produced by the CEL lexer.
-
Constructor Summary
ConstructorsConstructorDescriptionCelToken(CelTokenType type, String text, long intVal, double floatVal, boolean boolVal, int pos) Creates an instance of aCelTokenrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanboolVal()Returns the value of theboolValrecord component.final booleanIndicates whether some other object is "equal to" this one.doublefloatVal()Returns the value of thefloatValrecord component.final inthashCode()Returns a hash code value for this object.longintVal()Returns the value of theintValrecord component.static CelTokenof(CelTokenType type, String text, int pos) static CelTokenstatic CelTokenstatic CelTokenstatic CelTokenintpos()Returns the value of theposrecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
CelToken
public CelToken(CelTokenType type, String text, long intVal, double floatVal, boolean boolVal, int pos) Creates an instance of aCelTokenrecord class.- Parameters:
type- the value for thetyperecord componenttext- the value for thetextrecord componentintVal- the value for theintValrecord componentfloatVal- the value for thefloatValrecord componentboolVal- the value for theboolValrecord componentpos- the value for theposrecord component
-
-
Method Details
-
of
-
ofInt
-
ofFloat
-
ofBool
-
ofString
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
intVal
public long intVal()Returns the value of theintValrecord component.- Returns:
- the value of the
intValrecord component
-
floatVal
public double floatVal()Returns the value of thefloatValrecord component.- Returns:
- the value of the
floatValrecord component
-
boolVal
public boolean boolVal()Returns the value of theboolValrecord component.- Returns:
- the value of the
boolValrecord component
-
pos
public int pos()Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-