@Test public void testEquals_NotEqual_ObjectProperties() { Object invalidObject = new Object(); ObjectProperty objectProperty = new ObjectProperty(invalidObject); ValidationMarker validationMarker = () -> false; Message message1 = Message.builder("text", Severity.INFO).code("code").markers(validationMarker) .invalidObjectWithProperties(invalidObject).create(); Message message2 = Message.builder("text", Severity.INFO).code("code").markers(validationMarker) .invalidObjects(objectProperty, objectProperty).create(); Message message3 = Message.builder("text", Severity.INFO).code("code").markers(validationMarker) .invalidObjectWithProperties(invalidObject, "foo", "bar").create(); assertThat(message1, is(not(equalTo(message2)))); assertThat(message1, is(not(equalTo(message3)))); }
public static Builder builder(String text, Severity severity) { Objects.requireNonNull(text, "text must not be null"); Objects.requireNonNull(severity, "severity must not be null"); return new Builder(text, severity); }
Message implements Serializable { public static Builder builder(String text, Severity severity) { Objects.requireNonNull(text, "text must not be null"); Objects.requireNonNull(severity, "severity must not be null"); return new Builder(text, severity); } }
Message implements Serializable { public static Builder builder(String text, Severity severity) { Objects.requireNonNull(text, "text must not be null"); Objects.requireNonNull(severity, "severity must not be null"); return new Builder(text, severity); } Message(@CheckForNull String code, String text, Severity severity);   Message(@CheckForNull String code, String text, Severity severity,
            @CheckForNull List<ObjectProperty> invalidObjectProperties, @CheckForNull Set<ValidationMarker> markers); }
Message implements Serializable { public static Builder builder(String text, Severity severity) { Objects.requireNonNull(text, "text must not be null"); Objects.requireNonNull(severity, "severity must not be null"); return new Builder(text, severity); } Message(@CheckForNull String code, String text, Severity severity);   Message(@CheckForNull String code, String text, Severity severity,
            @CheckForNull List<ObjectProperty> invalidObjectProperties, @CheckForNull Set<ValidationMarker> markers); static Message newInfo(String code, String text); static Message newWarning(String code, String text); static Message newError(String code, String text); Severity getSeverity(); String getText(); @CheckForNull String getCode(); List<ObjectProperty> getInvalidObjectProperties(); Set<ValidationMarker> getMarkers(); boolean hasMarker(ValidationMarker marker); boolean hasMarkers(); boolean isMandatoryFieldMessage(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static Builder builder(String text, Severity severity); }
Message implements Serializable { public static Builder builder(String text, Severity severity) { Objects.requireNonNull(text, "text must not be null"); Objects.requireNonNull(severity, "severity must not be null"); return new Builder(text, severity); } Message(@CheckForNull String code, String text, Severity severity);   Message(@CheckForNull String code, String text, Severity severity,
            @CheckForNull List<ObjectProperty> invalidObjectProperties, @CheckForNull Set<ValidationMarker> markers); static Message newInfo(String code, String text); static Message newWarning(String code, String text); static Message newError(String code, String text); Severity getSeverity(); String getText(); @CheckForNull String getCode(); List<ObjectProperty> getInvalidObjectProperties(); Set<ValidationMarker> getMarkers(); boolean hasMarker(ValidationMarker marker); boolean hasMarkers(); boolean isMandatoryFieldMessage(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static Builder builder(String text, Severity severity);  }