Package dev.cel.common.types
Class SimpleType
- java.lang.Object
-
- dev.cel.common.types.CelType
-
- dev.cel.common.types.SimpleType
-
@CheckReturnValue @Immutable public abstract class SimpleType extends CelType
Simple types represent scalar, dynamic, and error values.
-
-
Field Summary
Fields Modifier and Type Field Description static CelTypeANYstatic CelTypeBOOLstatic CelTypeBYTESstatic CelTypeDOUBLEstatic CelTypeDURATIONstatic CelTypeDYNstatic CelTypeERRORstatic CelTypeINTstatic CelTypeNULL_TYPEstatic CelTypeSTRINGstatic CelTypeTIMESTAMPstatic com.google.common.collect.ImmutableMap<java.lang.String,CelType>TYPE_MAPstatic CelTypeUINT
-
Constructor Summary
Constructors Constructor Description SimpleType()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static java.util.Optional<CelType>findByName(java.lang.String typeName)Returns a matching SimpleType by its name if one exists.booleanisAssignableFrom(CelType other)Determine whetherthistype is assignable from theothertype value.abstract CelKindkind()Return the typeCelKind.abstract java.lang.Stringname()Return the type name.-
Methods inherited from class dev.cel.common.types.CelType
parameters, withFreshTypeParamVariables, withParameters
-
-
-
-
Field Detail
-
ERROR
public static final CelType ERROR
-
DYN
public static final CelType DYN
-
ANY
public static final CelType ANY
-
BOOL
public static final CelType BOOL
-
BYTES
public static final CelType BYTES
-
DOUBLE
public static final CelType DOUBLE
-
DURATION
public static final CelType DURATION
-
INT
public static final CelType INT
-
NULL_TYPE
public static final CelType NULL_TYPE
-
STRING
public static final CelType STRING
-
TIMESTAMP
public static final CelType TIMESTAMP
-
UINT
public static final CelType UINT
-
TYPE_MAP
public static final com.google.common.collect.ImmutableMap<java.lang.String,CelType> TYPE_MAP
-
-
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
-
findByName
public static java.util.Optional<CelType> findByName(java.lang.String typeName)
Returns a matching SimpleType by its name if one exists.
-
-