Record Class Violation
java.lang.Object
java.lang.Record
dev.archunitjava.result.Violation
- All Implemented Interfaces:
Comparable<Violation>
public record Violation(ViolationId id, String code, Severity severity, List<ViolationSubject> subjects, List<DependencyEvidence> evidence, Map<String,String> attributes)
extends Record
implements Comparable<Violation>
Structured architecture-rule failure data, with no renderer-owned prose.
-
Constructor Summary
ConstructorsConstructorDescriptionViolation(ViolationId id, String code, Severity severity, List<ViolationSubject> subjects, List<DependencyEvidence> evidence, Map<String, String> attributes) Creates an instance of aViolationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributesrecord component.code()Returns the value of thecoderecord component.intfinal booleanIndicates whether some other object is "equal to" this one.evidence()Returns the value of theevidencerecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.severity()Returns the value of theseverityrecord component.subjects()Returns the value of thesubjectsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Violation
public Violation(ViolationId id, String code, Severity severity, List<ViolationSubject> subjects, List<DependencyEvidence> evidence, Map<String, String> attributes) Creates an instance of aViolationrecord class.- Parameters:
id- the value for theidrecord componentcode- the value for thecoderecord componentseverity- the value for theseverityrecord componentsubjects- the value for thesubjectsrecord componentevidence- the value for theevidencerecord componentattributes- the value for theattributesrecord component
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<Violation>
-
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
code
Returns the value of thecoderecord component.- Returns:
- the value of the
coderecord component
-
severity
Returns the value of theseverityrecord component.- Returns:
- the value of the
severityrecord component
-
subjects
Returns the value of thesubjectsrecord component.- Returns:
- the value of the
subjectsrecord component
-
evidence
Returns the value of theevidencerecord component.- Returns:
- the value of the
evidencerecord component
-
attributes
-