Class EqualMessageIgnoring<M extends com.google.protobuf.Message>

  • Type Parameters:
    M - Message type.
    All Implemented Interfaces:
    org.hamcrest.Matcher<M>, org.hamcrest.SelfDescribing

    public class EqualMessageIgnoring<M extends com.google.protobuf.Message>
    extends org.hamcrest.BaseMatcher<M>
    Matcher for checking equality between messages that can ignore fields and extensions.
    • Field Detail

      • expected

        protected final M extends com.google.protobuf.Message expected
    • Constructor Detail

      • EqualMessageIgnoring

        public EqualMessageIgnoring​(M expected,
                                    boolean ignoreExtensions,
                                    Set<String> ignoringFields)
        Parameters:
        expected - Expected message.
        ignoreExtensions - If all extensions should be ignored.
        ignoringFields - Ignored fields. This can be any field descriptor, including extensions.
    • Method Detail

      • matches

        public boolean matches​(Object o)
      • describeTo

        public void describeTo​(org.hamcrest.Description description)
      • describeMismatch

        public void describeMismatch​(Object item,
                                     org.hamcrest.Description description)
        Specified by:
        describeMismatch in interface org.hamcrest.Matcher<M extends com.google.protobuf.Message>
        Overrides:
        describeMismatch in class org.hamcrest.BaseMatcher<M extends com.google.protobuf.Message>