Package dev.cel.common.types
Class NullableType
- java.lang.Object
-
- dev.cel.common.types.CelType
-
- dev.cel.common.types.NullableType
-
@CheckReturnValue @Immutable public abstract class NullableType extends CelType
Nullable types are a union type which indicate that the value is either thetargetTypeorSimpleType.NULL_TYPE
-
-
Constructor Summary
Constructors Constructor Description NullableType()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static NullableTypecreate(CelType targetType)booleanisAssignableFrom(CelType other)Determine whetherthistype is assignable from theothertype value.abstract CelKindkind()Return the typeCelKind.abstract java.lang.Stringname()Return the type name.abstract CelTypetargetType()CelTypewithFreshTypeParamVariables(java.util.function.Function<java.lang.String,java.lang.String> varNameGenerator)Instantiate a new copy of this type with alternativeparameters.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
parameters
-
-
-
-
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.
-
isAssignableFrom
public boolean isAssignableFrom(CelType other)
Description copied from class:CelTypeDetermine whetherthistype is assignable from theothertype value.Defaults to an equality test.
- Overrides:
isAssignableFromin classCelType
-
targetType
public abstract CelType targetType()
-
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
-
withFreshTypeParamVariables
public CelType withFreshTypeParamVariables(java.util.function.Function<java.lang.String,java.lang.String> varNameGenerator)
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:
withFreshTypeParamVariablesin classCelType
-
create
public static NullableType create(CelType targetType)
-
-