Package cdc.issues
Class Issue
- java.lang.Object
-
- cdc.issues.Issue
-
public class Issue extends Object
Base class used to describe an Issue (more exactly an occurrence of detection of an issue).Node: This class can be specialized if necessary.
An issue may have several target locations.
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.Builder<B extends Issue.Builder<B>>Builder ofIssue.
-
Field Summary
Fields Modifier and Type Field Description static Comparator<Issue>TIMESTAMP_COMPARATORComparator of Issues sing timestamp.
-
Constructor Summary
Constructors Modifier Constructor Description protectedIssue(Issue.Builder<?> builder)protectedIssue(String domain, Enum<?> name, Params params, String project, List<? extends Location> locations, String snapshot, IssueSeverity severity, String description, Params metas)protectedIssue(String domain, String name, Params params, String project, List<? extends Location> locations, String snapshot, IssueSeverity severity, String description, Params metas)protectedIssue(Instant timestamp, String domain, Enum<?> name, Params params, String project, List<? extends Location> locations, String snapshot, IssueSeverity severity, String description, Params metas)protectedIssue(Instant timestamp, String domain, String name, Params params, String project, List<? extends Location> locations, String snapshot, IssueSeverity severity, String description, Params metas)Creates an Issue.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Issue.Builder<?>builder()booleanequals(Object object)StringgetDescription()StringgetDomain()IssueIdgetId()LocationgetLocationAt(int index)<L extends Location>
LgetLocationAt(int index, Class<L> cls)Location[]getLocations()ParamsgetMetas()StringgetName()<T extends Enum<T>>
TgetName(Class<T> typeClass)intgetNumberOfLocations()ParamsgetParams()StringgetProject()RuleIdgetRuleId()IssueSeveritygetSeverity()StringgetSnapshot()InstantgetTimestamp()inthashCode()StringtoString()
-
-
-
Field Detail
-
TIMESTAMP_COMPARATOR
public static final Comparator<Issue> TIMESTAMP_COMPARATOR
Comparator of Issues sing timestamp.
-
-
Constructor Detail
-
Issue
protected Issue(Issue.Builder<?> builder)
-
Issue
protected Issue(Instant timestamp, String domain, String name, Params params, String project, List<? extends Location> locations, String snapshot, IssueSeverity severity, String description, Params metas)
Creates an Issue.- Parameters:
timestamp- The optional timestamp.domain- The rule domain.name- The rule name.params- The rule parameters.project- The project name.locations- The target locations.snapshot- The issue snapshot.severity- The issue severity.description- The issue description.metas- The issue meta data.
-
Issue
protected Issue(String domain, String name, Params params, String project, List<? extends Location> locations, String snapshot, IssueSeverity severity, String description, Params metas)
-
Issue
protected Issue(Instant timestamp, String domain, Enum<?> name, Params params, String project, List<? extends Location> locations, String snapshot, IssueSeverity severity, String description, Params metas)
-
-
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 the rule of this issue.
-
getName
public String getName()
- Returns:
- The name of the rule of this rule.
-
getParams
public Params getParams()
- Returns:
- The rule parameters of this issue.
-
getProject
public String getProject()
- Returns:
- The project of this issue.
May be
null.
-
getSnapshot
public String getSnapshot()
- Returns:
- The snapshot of this issue.
May be
null.
-
getSeverity
public final IssueSeverity getSeverity()
- Returns:
- The severity of this issue.
-
getDescription
public final String getDescription()
- Returns:
- The description of this issue.
-
getMetas
public Params getMetas()
- Returns:
- The meta data associated to this issue.
-
getLocations
public Location[] getLocations()
- Returns:
- The target locations of this issue.
-
getNumberOfLocations
public final int getNumberOfLocations()
- Returns:
- The number of target locations of this issue.
-
getLocationAt
public Location getLocationAt(int index)
-
builder
public static Issue.Builder<?> builder()
- Returns:
- A new
Issue.BuilderofIssue.
-
-