Package dev.cel.common.types
Class OpaqueType
- java.lang.Object
-
- dev.cel.common.types.CelType
-
- dev.cel.common.types.OpaqueType
-
@CheckReturnValue @Immutable public abstract class OpaqueType extends CelType
An opaque type's properties may only be accessed via function calls associated with the type.Apart from protobuf messages, opaque types are the preferred extension mechanism for introducing first-order types into CEL.
-
-
Constructor Summary
Constructors Constructor Description OpaqueType()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static OpaqueTypecreate(java.lang.String typeName, com.google.common.collect.ImmutableList<CelType> parameters)static OpaqueTypecreate(java.lang.String typeName, CelType... parameters)abstract CelKindkind()Return the typeCelKind.abstract java.lang.Stringname()Return the type name.abstract com.google.common.collect.ImmutableList<CelType>parameters()Return the type parameters.CelTypewithParameters(com.google.common.collect.ImmutableList<CelType> parameters)Instantiate a new copy of this type with alternativeparameters.-
Methods inherited from class dev.cel.common.types.CelType
isAssignableFrom, withFreshTypeParamVariables
-
-
-
-
Method Detail
-
name
public abstract java.lang.String name()
Description copied from class:CelTypeReturn the type name.For struct types this should be the fully qualified name. Be wary of introducing unqualified type names as they may collide with future CEL type.
-
parameters
public abstract com.google.common.collect.ImmutableList<CelType> parameters()
Description copied from class:CelTypeReturn the type parameters. e.g. a map's key and valueCelType.- Overrides:
parametersin classCelType
-
withParameters
public CelType withParameters(com.google.common.collect.ImmutableList<CelType> parameters)
Description copied from class:CelTypeInstantiate a new copy of this type with alternativeparameters.If the
CelTypedoes not have anyparameters, then the return value defaults to the original type instance.- Overrides:
withParametersin classCelType
-
create
public static OpaqueType create(java.lang.String typeName, CelType... parameters)
-
create
public static OpaqueType create(java.lang.String typeName, com.google.common.collect.ImmutableList<CelType> parameters)
-
-