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.

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 sing timestamp.
  • Constructor Details

    • Issue

      protected Issue(Issue.Builder<?> builder)
    • Issue

      @Deprecated(forRemoval=true, since="2023-10-14") protected Issue(Instant timestamp, String domain, String name, Params params, String project, List<? extends Location> locations, String snapshot, IssueSeverity severity, String description, Params metas)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Do not use anymore. Issue will be made final.
      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

      @Deprecated(forRemoval=true, since="2023-10-14") protected Issue(String domain, String name, Params params, String project, List<? extends Location> locations, String snapshot, IssueSeverity severity, String description, Params metas)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Do not use anymore. Issue will be made final.
      Parameters:
      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

      @Deprecated(forRemoval=true, since="2023-10-14") protected Issue(Instant timestamp, String domain, Enum<?> name, Params params, String project, List<? extends Location> locations, String snapshot, IssueSeverity severity, String description, Params metas)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Do not use anymore. Issue will be made final.
      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

      @Deprecated(forRemoval=true, since="2023-10-14") protected Issue(String domain, Enum<?> name, Params params, String project, List<? extends Location> locations, String snapshot, IssueSeverity severity, String description, Params metas)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Do not use anymore. Issue will be made final.
      Parameters:
      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.
  • 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.
    • 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)
    • 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)
    • 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.