Package dev.cel.common.values
Class ProtoMessageValue
- java.lang.Object
-
- dev.cel.common.values.CelValue
-
- dev.cel.common.values.StructValue<StringValue>
-
- dev.cel.common.values.ProtoMessageValue
-
- All Implemented Interfaces:
SelectableValue<StringValue>
@Immutable public abstract class ProtoMessageValue extends StructValue<StringValue>
ProtoMessageValue is a struct value with protobuf support.
-
-
Constructor Summary
Constructors Constructor Description ProtoMessageValue()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract CelTypecelType()The CelType that represents this value.static ProtoMessageValuecreate(Message value, CelDescriptorPool celDescriptorPool, ProtoCelValueConverter protoCelValueConverter)java.util.Optional<CelValue>find(StringValue field)Finds the field.booleanisZeroValue()Returns true if theCelValue.value()is a zero value for its type.CelValueselect(StringValue field)Performs field selection.abstract Messagevalue()The underlying value.
-
-
-
Method Detail
-
value
public abstract Message value()
Description copied from class:CelValueThe underlying value. This is typically the Java native value or a derived instance of CelValue (ex: an element in lists or key/value pair in maps).
-
celType
public abstract CelType celType()
Description copied from class:CelValueThe CelType that represents this value.
-
isZeroValue
public boolean isZeroValue()
Description copied from class:CelValueReturns true if theCelValue.value()is a zero value for its type.- Specified by:
isZeroValuein classCelValue
-
select
public CelValue select(StringValue field)
Description copied from interface:SelectableValuePerforms field selection. The behavior depends on the concrete implementation of the value being selected. For structs and maps, this must throw an exception if the field does not exist. For optional values, this will return anoptional.none().
-
find
public java.util.Optional<CelValue> find(StringValue field)
Description copied from interface:SelectableValueFinds the field. This will return anOptional.empty()if the field does not exist. This can be used for presence testing.
-
create
public static ProtoMessageValue create(Message value, CelDescriptorPool celDescriptorPool, ProtoCelValueConverter protoCelValueConverter)
-
-