Package cdc.issues.api
Class Issue<T>
- java.lang.Object
-
- cdc.issues.api.Issue<T>
-
- Type Parameters:
T- The issue type.
public class Issue<T> 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,T>,I extends Issue<T>,T>static classIssue.Builder<T>
-
Constructor Summary
Constructors Constructor Description Issue(IssueId<T> id, IssueLevel level, String description)Creates an Issue.Issue(IssueId<T> id, IssueLevel level, String description, Throwable cause)Creates an Issue.Issue(T type, List<? extends IssueLocation> locations, IssueLevel level, String description)Creates an Issue.Issue(T type, List<? extends IssueLocation> locations, IssueLevel level, String description, Throwable cause)Creates an Issue.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Issue.Builder<T>builder(Class<T> typeClass)ThrowablegetCause()StringgetDescription()IssueId<T>getId()IssueLevelgetIssueLevel()TgetIssueType()IssueLocationgetLocationAt(int index)<L extends IssueLocation>
LgetLocationAt(int index, Class<L> cls)IssueLocation[]getLocations()intgetNumberOfLocations()InstantgetTimestamp()StringtoString()
-
-
-
Constructor Detail
-
Issue
public Issue(IssueId<T> id, IssueLevel level, String description, Throwable cause)
Creates an Issue.- Parameters:
id- The issue id.level- The issue level.description- The issue description.cause- The optional cause.
-
Issue
public Issue(IssueId<T> id, IssueLevel level, String description)
Creates an Issue.- Parameters:
id- The issue id.level- The issue level.description- The issue description.
-
Issue
public Issue(T type, List<? extends IssueLocation> locations, IssueLevel level, String description, Throwable cause)
Creates an Issue.- Parameters:
type- The issue type.locations- The target locations.level- The issue level.description- The issue description.cause- The optional cause.
-
Issue
public Issue(T type, List<? extends IssueLocation> locations, IssueLevel level, String description)
Creates an Issue.- Parameters:
type- The issue type.locations- The target locations.level- The issue level.description- The issue description.
-
-
Method Detail
-
getTimestamp
public final Instant getTimestamp()
- Returns:
- The Instant at which this issue was created.
-
getIssueType
public T getIssueType()
- Returns:
- The type of this issue.
-
getIssueLevel
public final IssueLevel getIssueLevel()
- Returns:
- The level 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 <T> Issue.Builder<T> builder(Class<T> typeClass)
-
-