Package org.revapi
Class Criticality
- java.lang.Object
-
- org.revapi.Criticality
-
- All Implemented Interfaces:
Comparable<Criticality>
public final class Criticality extends Object implements Comparable<Criticality>
Criticality represents the assigned importance of aDifference
. While difference has its classifications and severities, criticality expresses how that classification is perceived in the concrete case of the difference. An API author might consider it OK to have breaking changes in certain part of API, yet wants to highlight to the users in reports that those are indeed breaking. It would not have therefore been enough to just reclassify the difference as non-breaking. There are a couple of predefined criticalities that are always present in the analysis and are ready to use:
-
-
Field Summary
Fields Modifier and Type Field Description static Criticality
ALLOWED
Differences with this criticality are allowed and considered OK.static Criticality
DOCUMENTED
Differences with this criticality are necessary in the project and are documented.static Criticality
ERROR
Differences with this criticality are not allowed and should be dealt with in the checked codebase.static Criticality
HIGHLIGHT
Differences with this criticality are necessary in the project, are documented and are very important/severe so should be highlighted in the reports.
-
Constructor Summary
Constructors Constructor Description Criticality(String name, int level)
Creates a new criticality instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Criticality o)
static Set<Criticality>
defaultCriticalities()
The default set of criticalities known to the pipeline configuration.static Map<DifferenceSeverity,Criticality>
defaultSeverityMapping()
The default mapping from difference severity to criticality used in the analysis context if not configured otherwise.boolean
equals(Object o)
int
getLevel()
String
getName()
int
hashCode()
String
toString()
-
-
-
Field Detail
-
ALLOWED
public static final Criticality ALLOWED
Differences with this criticality are allowed and considered OK. Thelevel
of this criticality is 1000.
-
DOCUMENTED
public static final Criticality DOCUMENTED
Differences with this criticality are necessary in the project and are documented. Thelevel
of this criticality is 2000.
-
HIGHLIGHT
public static final Criticality HIGHLIGHT
Differences with this criticality are necessary in the project, are documented and are very important/severe so should be highlighted in the reports. Thelevel
of this criticality is 3000.
-
ERROR
public static final Criticality ERROR
Differences with this criticality are not allowed and should be dealt with in the checked codebase. Thelevel
of this criticality is the maximum integer value. There can be no criticality more severe than this.
-
-
Constructor Detail
-
Criticality
public Criticality(String name, int level)
Creates a new criticality instance.- Parameters:
name
- the human readable name of the criticalitylevel
- how critical it is. A non-negative integer
-
-
Method Detail
-
defaultCriticalities
public static Set<Criticality> defaultCriticalities()
The default set of criticalities known to the pipeline configuration.
-
defaultSeverityMapping
public static Map<DifferenceSeverity,Criticality> defaultSeverityMapping()
The default mapping from difference severity to criticality used in the analysis context if not configured otherwise.
-
getName
public String getName()
-
getLevel
public int getLevel()
-
compareTo
public int compareTo(Criticality o)
- Specified by:
compareTo
in interfaceComparable<Criticality>
-
-