Package dev.cel.runtime
Class ProtoMessageRuntimeEquality
- java.lang.Object
-
- dev.cel.runtime.RuntimeEquality
-
- dev.cel.runtime.ProtoMessageRuntimeEquality
-
@Internal @Immutable public final class ProtoMessageRuntimeEquality extends RuntimeEquality
ProtoMessageRuntimeEquality contains methods for performing CEL related equality checks, including full protobuf messages by leveraging descriptors.CEL Library Internals. Do Not Use.
-
-
Field Summary
-
Fields inherited from class dev.cel.runtime.RuntimeEquality
celOptions, runtimeHelpers
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProtoMessageRuntimeEqualitycreate(DynamicProto dynamicProto, dev.cel.common.CelOptions celOptions)booleanobjectEquals(java.lang.Object x, java.lang.Object y)CEL implements homogeneous equality where two values are only comparable if they have the same type, otherwise an error is thrown.
-
-
-
Method Detail
-
create
@Internal public static ProtoMessageRuntimeEquality create(DynamicProto dynamicProto, dev.cel.common.CelOptions celOptions)
-
objectEquals
public boolean objectEquals(java.lang.Object x, java.lang.Object y)Description copied from class:RuntimeEqualityCEL implements homogeneous equality where two values are only comparable if they have the same type, otherwise an error is thrown.If the values are of different type, the comparison fails with an error. For aggregate types, equality
If lists are of different length, return false, otherwise take the CEL logical AND of homogeneous equality of the elements by list position:
- If any element comparison returns false, the list comparison returns false.
- Otherwise, if all element comparisons return true, the list comparison returns true.
- Otherwise, there are one or more errors, one of which is re-thrown.
If maps have different key sets, return false, otherwise take the CEL logical AND of homogeneous equality of the values by map key:
- If any value comparison returns false, the map comparison returns false.
- Otherwise, if all value comparisons return true, the map comparison returns true.
- Otherwise, there are one or more errors, one of which is re-thrown.
Heterogeneous equality differs from homogeneous equality in that two objects may be comparable even if they are not of the same type, where type differences are usually trivially false.
- Overrides:
objectEqualsin classRuntimeEquality
-
-