Enum ExprFeatures
- java.lang.Object
-
- java.lang.Enum<ExprFeatures>
-
- dev.cel.common.ExprFeatures
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ExprFeatures>
@Deprecated public enum ExprFeatures extends java.lang.Enum<ExprFeatures>
Deprecated.UseCelOptions
instead.ExprFeatures are flags that alter how the CEL Java parser, checker, and interpreter behave.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description COMPILE_TIME_OVERLOAD_RESOLUTION
Deprecated.Require overloads to resolve (narrow to a single candidate) during type checking.ENABLE_HETEROGENEOUS_NUMERIC_COMPARISONS
Deprecated.Enable numeric comparisons across types.ENABLE_NAMESPACED_DECLARATIONS
Deprecated.Enables the usage of namespaced functions and identifiers.ENABLE_TIMESTAMP_EPOCH
Deprecated.Enable the timestamp from epoch overload.ENABLE_UNSIGNED_LONGS
Deprecated.Enable the using ofUnsignedLong
values in place ofLong
values for unsigned integers.ERROR_ON_DUPLICATE_KEYS
Deprecated.Error on duplicate keys in map literals.ERROR_ON_WRAP
Deprecated.Throw errors when ints or uints wrap.HOMOGENEOUS_LITERALS
Deprecated.During type checking require list-, and map literals to be type-homogeneous in their element-, key-, and value types, respectively.LEGACY_JAVA_EQUALITY
Deprecated.When enabled use Java equality for (in)equality tests.POPULATE_MACRO_CALLS
Deprecated.Populate macro_calls map in source_info with macro calls parsed from the expression.PROTO_DIFFERENCER_EQUALITY
Deprecated.Enable proto differencer based equality for messages.REGEX_PARTIAL_MATCH
Deprecated.Treat regexmatches
calls as substring (unanchored) match patterns.RESERVED_IDS
Deprecated.Check for use of reserved identifiers during parsing.RETAIN_REPEATED_UNARY_OPERATORS
Deprecated.Retain all invocations of unary '-' and '!' that occur in source in the abstract syntax.RETAIN_UNBALANCED_LOGICAL_EXPRESSIONS
Deprecated.Retain the original grouping of logical connectives '&&' and '||' without attempting to rebalance them in the abstract syntax.UNSIGNED_COMPARISON_AND_ARITHMETIC_IS_UNSIGNED
Deprecated.Treat unsigned integers as unsigned when doing arithmetic and comparisons.
-
Field Summary
Fields Modifier and Type Field Description static com.google.common.collect.ImmutableSet<ExprFeatures>
CURRENT
Deprecated.Feature flags that enable the current best practices for CEL.static com.google.common.collect.ImmutableSet<ExprFeatures>
LEGACY
Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ExprFeatures
valueOf(java.lang.String name)
Deprecated.Returns the enum constant of this type with the specified name.static ExprFeatures[]
values()
Deprecated.Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
COMPILE_TIME_OVERLOAD_RESOLUTION
public static final ExprFeatures COMPILE_TIME_OVERLOAD_RESOLUTION
Deprecated.Require overloads to resolve (narrow to a single candidate) during type checking.This eliminates run-time overload dispatch and avoids implicit coercions of the result type to type dyn.
-
LEGACY_JAVA_EQUALITY
public static final ExprFeatures LEGACY_JAVA_EQUALITY
Deprecated.When enabled use Java equality for (in)equality tests.This feature is how the legacy CEL-Java APIs were originally configured, and in most cases will yield identical results to CEL equality, with the exception that equality between well-known protobuf types (wrapper types,
protobuf.Value
,protobuf.Any
) may not compare correctly to simple and aggregate CEL types.Additionally, Java equality across numeric types such as
double
andlong
, will be trivially false, whereas CEL equality will compare the values as though they exist on a continuous number line.
-
HOMOGENEOUS_LITERALS
public static final ExprFeatures HOMOGENEOUS_LITERALS
Deprecated.During type checking require list-, and map literals to be type-homogeneous in their element-, key-, and value types, respectively.Without this flag one can use type-mismatched elements, keys, and values, and the type checker will implicitly coerce them to type dyn.
-
REGEX_PARTIAL_MATCH
public static final ExprFeatures REGEX_PARTIAL_MATCH
Deprecated.Treat regexmatches
calls as substring (unanchored) match patterns.The default treatment for pattern matching within RE2 is full match within Java; however, the CEL standarda specifies that the matches() function is a substring match.
-
RESERVED_IDS
public static final ExprFeatures RESERVED_IDS
Deprecated.Check for use of reserved identifiers during parsing.See the language spec for a list of reserved identifiers.
-
RETAIN_REPEATED_UNARY_OPERATORS
public static final ExprFeatures RETAIN_REPEATED_UNARY_OPERATORS
Deprecated.Retain all invocations of unary '-' and '!' that occur in source in the abstract syntax.By default the parser collapses towers of repeated unary '-' and '!' into zero or one instance by assuming these operators to be inverses of themselves. This behavior may not always be desirable.
-
RETAIN_UNBALANCED_LOGICAL_EXPRESSIONS
public static final ExprFeatures RETAIN_UNBALANCED_LOGICAL_EXPRESSIONS
Deprecated.Retain the original grouping of logical connectives '&&' and '||' without attempting to rebalance them in the abstract syntax.The default rebalancing can reduce the overall nesting depth of the generated protos representing abstract syntax, but it relies on associativity of the operations themselves. This behavior may not always be desirable.
-
UNSIGNED_COMPARISON_AND_ARITHMETIC_IS_UNSIGNED
public static final ExprFeatures UNSIGNED_COMPARISON_AND_ARITHMETIC_IS_UNSIGNED
Deprecated.Treat unsigned integers as unsigned when doing arithmetic and comparisons.Prior to turning on this feature, attempts to perform arithmetic or comparisons on unsigned integers larger than 2^63-1 may result in a runtime exception in the form of an
IllegalArgumentException
.
-
ERROR_ON_WRAP
public static final ExprFeatures ERROR_ON_WRAP
Deprecated.Throw errors when ints or uints wrap.Prior to this feature, int and uint arithmetic wrapped, i.e. was coerced into range via mod 2^64. The spec settled on throwing an error instead. Note that this makes arithmetic non- associative.
-
ERROR_ON_DUPLICATE_KEYS
public static final ExprFeatures ERROR_ON_DUPLICATE_KEYS
Deprecated.Error on duplicate keys in map literals.
-
POPULATE_MACRO_CALLS
public static final ExprFeatures POPULATE_MACRO_CALLS
Deprecated.Populate macro_calls map in source_info with macro calls parsed from the expression.
-
ENABLE_TIMESTAMP_EPOCH
public static final ExprFeatures ENABLE_TIMESTAMP_EPOCH
Deprecated.Enable the timestamp from epoch overload. This will automatically move to CURRENT after a two month notice to consumers.TODO: Remove this feature once it has been auto-enabled.
-
ENABLE_HETEROGENEOUS_NUMERIC_COMPARISONS
public static final ExprFeatures ENABLE_HETEROGENEOUS_NUMERIC_COMPARISONS
Deprecated.Enable numeric comparisons across types. This will automatically move to CURRENT after a two month notice to consumers.TODO: Remove this feature once it has been auto-enabled.
-
ENABLE_UNSIGNED_LONGS
public static final ExprFeatures ENABLE_UNSIGNED_LONGS
Deprecated.Enable the using ofUnsignedLong
values in place ofLong
values for unsigned integers.Note, users must be careful not to supply
Long
values whenUnsignedLong
values are intended.
-
PROTO_DIFFERENCER_EQUALITY
public static final ExprFeatures PROTO_DIFFERENCER_EQUALITY
Deprecated.Enable proto differencer based equality for messages. This is in place of Message.equals() which has a slightly different behavior.
-
ENABLE_NAMESPACED_DECLARATIONS
public static final ExprFeatures ENABLE_NAMESPACED_DECLARATIONS
Deprecated.Enables the usage of namespaced functions and identifiers. This causes the type-checker to rewrite the AST to support namespacing.
-
-
Field Detail
-
CURRENT
public static final com.google.common.collect.ImmutableSet<ExprFeatures> CURRENT
Deprecated.Feature flags that enable the current best practices for CEL.
-
LEGACY
public static final com.google.common.collect.ImmutableSet<ExprFeatures> LEGACY
Deprecated.
-
-
Method Detail
-
values
public static ExprFeatures[] values()
Deprecated.Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ExprFeatures c : ExprFeatures.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ExprFeatures valueOf(java.lang.String name)
Deprecated.Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-