Class 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.

    • Method Detail

      • objectEquals

        public boolean objectEquals​(java.lang.Object x,
                                    java.lang.Object y)
        Description copied from class: RuntimeEquality
        CEL 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:
        objectEquals in class RuntimeEquality