Package org.revapi

Class Criticality

  • All Implemented Interfaces:
    Comparable<Criticality>

    public final class Criticality
    extends Object
    implements Comparable<Criticality>
    Criticality represents the assigned importance of a 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:
    1. ALLOWED
    2. DOCUMENTED
    3. HIGHLIGHT
    4. ERROR
    • Field Detail

      • ALLOWED

        public static final Criticality ALLOWED
        Differences with this criticality are allowed and considered OK. The level of this criticality is 1000.
      • DOCUMENTED

        public static final Criticality DOCUMENTED
        Differences with this criticality are necessary in the project and are documented. The level 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. The level 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. The level 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 criticality
        level - 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()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object