Package dev.cel.common.values
Class StructValue<F,V>
- java.lang.Object
-
- dev.cel.common.values.CelValue
-
- dev.cel.common.values.StructValue<F,V>
-
- Type Parameters:
F- The type of the field identifier. OnlyStringis supported for now, but we may extend support to other types in the future.V- The type of the wrapped native object.
- All Implemented Interfaces:
SelectableValue<F>
@Immutable public abstract class StructValue<F,V> extends CelValue implements SelectableValue<F>
StructValue is a representation of a structured object with typed properties.Users may extend from this class to provide a custom struct that CEL can understand by wrapping a native Java object (e.g., a POJO or a Map). Custom struct implementations must provide all functionalities denoted in the CEL specification, such as field selection, presence testing and new object creation.
For an expression `e` selecting a field `f`, `e.f` must throw an exception if `f` does not exist in the struct (i.e: hasField returns false). If the field exists but is not set, the implementation should return an appropriate default value based on the struct's semantics.
-
-
Constructor Summary
Constructors Constructor Description StructValue()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract Vvalue()The underlying value.-
Methods inherited from class dev.cel.common.values.CelValue
celType, isZeroValue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface dev.cel.common.values.SelectableValue
find, select
-
-