Package cdc.issues

Class Issue

java.lang.Object
cdc.issues.Issue
All Implemented Interfaces:
LabelsItem, MetasItem

public class Issue extends Object implements MetasItem, LabelsItem
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.

WARNNING
Issue should probably NOT be derived.
Currently, IO implementations only produce the base Issue class. There is no support to build any derived class.

If you however do so, it is highly recommended not to add any attribute. If you do that, those attributes won't be retrieved by IO.

Author:
Damien Carbonne
  • Field Details

    • TIMESTAMP_COMPARATOR

      public static final Comparator<Issue> TIMESTAMP_COMPARATOR
      Comparator of Issues using timestamp.
  • Constructor Details

  • Method Details

    • getTimestamp

      public final Instant getTimestamp()
      Returns:
      The Instant at which this issue was created.
    • getId

      public IssueId getId()
      Returns:
      The id of this issue.
    • getIdHash

      public String getIdHash()
      Returns:
      The SHA1 digest of 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 issue.
    • getName

      public <T extends Enum<T>> T getName(Class<T> typeClass)
    • getTitle

      public String getTitle()
      Returns:
      The title of the rule of this issue.
    • 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 Metas getMetas()
      Specified by:
      getMetas in interface MetasItem
      Returns:
      The meta data associated to this issue.
    • getLabels

      public Labels getLabels()
      Specified by:
      getLabels in interface LabelsItem
      Returns:
      The labels 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)
    • getLocationAt

      public <L extends Location> L getLocationAt(int index, Class<L> cls)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static Issue.Builder<?> builder()
      Returns:
      A new Issue.Builder of Issue.