Package cdc.issues.api
Class Issue
- java.lang.Object
-
- cdc.issues.api.Issue
-
public class Issue extends Object
Base class used to describe an Issue.Node: This class can be specialized if necessary.
An issue may have several targets.
For example, when there is a compliance issue between several things, one can not tell which one is at fault.- Author:
- Damien Carbonne
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIssue.AbstractIssueBuilder<B extends Issue.AbstractIssueBuilder<B,I>,I extends Issue>static classIssue.Builder
-
Constructor Summary
Constructors Modifier Constructor Description protectedIssue(String domain, Enum<?> name, IssueParams params, List<? extends IssueLocation> locations, IssueSeverity severity, String description, Throwable cause)protectedIssue(String domain, String name, IssueParams params, List<? extends IssueLocation> locations, IssueSeverity severity, String description, Throwable cause)protectedIssue(Instant timestamp, String domain, Enum<?> name, IssueParams params, List<? extends IssueLocation> locations, IssueSeverity severity, String description, Throwable cause)protectedIssue(Instant timestamp, String domain, String name, IssueParams params, List<? extends IssueLocation> locations, IssueSeverity severity, String description, Throwable cause)Creates an Issue.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Issue.Builderbuilder()booleanequals(Object object)ThrowablegetCause()StringgetDescription()StringgetDomain()IssueIdgetId()IssueLocationgetLocationAt(int index)<L extends IssueLocation>
LgetLocationAt(int index, Class<L> cls)IssueLocation[]getLocations()StringgetName()<T extends Enum<T>>
TgetName(Class<T> typeClass)intgetNumberOfLocations()IssueParamsgetParams()RuleIdgetRuleId()IssueSeveritygetSeverity()InstantgetTimestamp()inthashCode()StringtoString()
-
-
-
Constructor Detail
-
Issue
protected Issue(Instant timestamp, String domain, String name, IssueParams params, List<? extends IssueLocation> locations, IssueSeverity severity, String description, Throwable cause)
Creates an Issue.- Parameters:
timestamp- The optional timestamp.name- The issue name.params- The parameters.locations- The target locations.severity- The issue severity.description- The issue description.cause- The optional cause.
-
Issue
protected Issue(String domain, String name, IssueParams params, List<? extends IssueLocation> locations, IssueSeverity severity, String description, Throwable cause)
-
Issue
protected Issue(Instant timestamp, String domain, Enum<?> name, IssueParams params, List<? extends IssueLocation> locations, IssueSeverity severity, String description, Throwable cause)
-
Issue
protected Issue(String domain, Enum<?> name, IssueParams params, List<? extends IssueLocation> locations, IssueSeverity severity, String description, Throwable cause)
-
-
Method Detail
-
getTimestamp
public final Instant getTimestamp()
- Returns:
- The Instant at which this issue was created.
-
getId
public IssueId getId()
- Returns:
- The id of this issue.
-
getRuleId
public RuleId getRuleId()
- Returns:
- The RuleId of this issue.
-
getDomain
public String getDomain()
- Returns:
- The domain of this issue.
-
getName
public String getName()
- Returns:
- The name of this issue.
-
getParams
public IssueParams getParams()
-
getSeverity
public final IssueSeverity getSeverity()
- Returns:
- The severity of this issue.
-
getDescription
public final String getDescription()
- Returns:
- The description of this issue.
-
getLocations
public IssueLocation[] getLocations()
- Returns:
- The target locations of this issue.
-
getNumberOfLocations
public final int getNumberOfLocations()
- Returns:
- The number of target locations of this issue.
-
getLocationAt
public IssueLocation getLocationAt(int index)
-
getLocationAt
public <L extends IssueLocation> L getLocationAt(int index, Class<L> cls)
-
getCause
public Throwable getCause()
- Returns:
- The cause of this issue, or
null.
-
builder
public static Issue.Builder builder()
-
-