Record Class ValidationReport
java.lang.Object
java.lang.Record
ch.nexsol.gateway.validation.ValidationReport
- Record Components:
errors- the contract violations, in the order they were found
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionand(ValidationReport other) Returns a report holding the violations of both reports.describe()Renders the violations as a single line, suitable for a log message or an audit attribute.static ValidationReportempty()Returns the report of a message that honours its contract.final booleanIndicates whether some other object is "equal to" this one.errors()Returns the value of theerrorsrecord component.final inthashCode()Returns a hash code value for this object.booleanisValid()Returns whether the message honours its contract.static ValidationReportReturns a report holding the given violations.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ValidationReport
-
-
Method Details
-
empty
Returns the report of a message that honours its contract.- Returns:
- an empty report
-
of
Returns a report holding the given violations.- Parameters:
errors- the contract violations- Returns:
- the report
-
and
Returns a report holding the violations of both reports.- Parameters:
other- the report to merge into this one- Returns:
- the merged report
-
isValid
public boolean isValid()Returns whether the message honours its contract.- Returns:
truewhen no violation was found
-
describe
Renders the violations as a single line, suitable for a log message or an audit attribute.- Returns:
- the violations joined by
"; "
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
errors
-