Record Class Check
java.lang.Object
java.lang.Record
com.thirtysevenaudits.auditor.Check
- Record Components:
code- structured identity for this check definition (not the individual finding), modeled asCheckCode. UseCheckCode.id()as the stable key when grouping findings—similar in spirit to Hibernate ORM message ids such asHHH000406. Recommendedidshapes include37A-AuditorName-NNN(e.g.37A-MyAuditor-001) or compact values such as37A-000123;CheckCode.description()may hold a short human-readable label. Must not benull.
public record Check(CheckStatus status, String resource, String message, String recommendation, int score, Map<String,Object> data, CheckCode code)
extends Record
A single audit finding.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncode()Returns the value of thecoderecord component.static Checkstatic longcountStatus(Collection<Check> checks, CheckStatus status) data()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.message()Returns the value of themessagerecord component.Returns the value of therecommendationrecord component.resource()Returns the value of theresourcerecord component.intscore()Returns the value of thescorerecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Check
public Check(CheckStatus status, String resource, String message, String recommendation, int score, Map<String, Object> data, CheckCode code) Creates an instance of aCheckrecord class.- Parameters:
status- the value for thestatusrecord componentresource- the value for theresourcerecord componentmessage- the value for themessagerecord componentrecommendation- the value for therecommendationrecord componentscore- the value for thescorerecord componentdata- the value for thedatarecord componentcode- the value for thecoderecord component
-
-
Method Details
-
countStatus
-
convertFailToWarning
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
resource
Returns the value of theresourcerecord component.- Returns:
- the value of the
resourcerecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
recommendation
Returns the value of therecommendationrecord component.- Returns:
- the value of the
recommendationrecord component
-
score
public int score()Returns the value of thescorerecord component.- Returns:
- the value of the
scorerecord component
-
data
-
code
-