Enum ResultOption

  • All Implemented Interfaces:
    Serializable, Comparable<ResultOption>

    public enum ResultOption
    extends Enum<ResultOption>
    Options to calculate a result aggregated on the operations of a class. ResultOptions allow us to return the sum, or average, or the highest value of the metric computed on the operations of a class. They help to reduce the need for custom implementations of those calculations in rules. Thus, they greatly reduce the amount of code required to produce detailed violation reports for classes.
    Since:
    5.8.0
    Author:
    Clément Fournier
    • Enum Constant Detail

      • SUM

        public static final ResultOption SUM
        Compute the sum on all operations.
      • AVERAGE

        public static final ResultOption AVERAGE
        Compute the average on all operations.
      • HIGHEST

        public static final ResultOption HIGHEST
        Compute the highest value among all operations.
    • Method Detail

      • values

        public static ResultOption[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ResultOption c : ResultOption.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ResultOption valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null