public final class Criticality extends Object implements Comparable<Criticality>
Difference
. 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:
Modifier and Type | Field and 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 and Description |
---|
Criticality(String name,
int level)
Creates a new criticality instance.
|
Modifier and Type | Method and 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() |
public static final Criticality ALLOWED
level
of this criticality is 1000.public static final Criticality DOCUMENTED
level
of this criticality is 2000.public static final Criticality HIGHLIGHT
level
of this criticality is 3000.public static final Criticality ERROR
level
of this criticality is the maximum integer value. There can be no criticality more
severe than this.public Criticality(String name, int level)
name
- the human readable name of the criticalitylevel
- how critical it is. A non-negative integerpublic static Set<Criticality> defaultCriticalities()
public static Map<DifferenceSeverity,Criticality> defaultSeverityMapping()
public String getName()
public int getLevel()
public int compareTo(Criticality o)
compareTo
in interface Comparable<Criticality>
Copyright © 2014-2020 Lukas Krejci. All Rights Reserved.