Package dev.cel.common.types
Class ListType
- java.lang.Object
-
- dev.cel.common.types.CelType
-
- dev.cel.common.types.ListType
-
@CheckReturnValue @Immutable public abstract class ListType extends CelType
Lists are a parameterized type with the parameter indicating theelemType.
-
-
Constructor Summary
Constructors Constructor Description ListType()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ListTypecreate()Do not use.static ListTypecreate(CelType elemType)CelTypeelemType()booleanhasElemType()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
-
hasElemType
public boolean hasElemType()
-
elemType
public CelType elemType()
-
create
@Internal public static ListType create()
Do not use. This exists for compatibility reason with ListType from checked.proto.Note that a parameterized collection, such as
List<Int>or aMap<Int, Int>, is a type-checker construct. An unparameterized list here is what the runtime looks at after type-erasure, typically for handling dynamic dispatch.
-
-