Enum FailureReason

    • Enum Constant Detail

      • MULTIPLE

        public static final FailureReason MULTIPLE
        There were multiple failures of different types.

        An operation may produce zero to many errors. If there is one error then that reason is used. If there are many errors then the overall reason is "multiple".

      • ERROR

        public static final FailureReason ERROR
        An error occurred.

        Where possible, a more specific reason code should be used.

      • INVALID

        public static final FailureReason INVALID
        The input was invalid.

        One or more input parameters was invalid.

      • PARSING

        public static final FailureReason PARSING
        A parsing error occurred.

        This is used when an error occurred during parsing. Typically, this refers to parsing a file, such as CSV or XML.


        public static final FailureReason NOT_APPLICABLE
        The operation requested was not applicable.

        This is used when the particular combination of inputs is not applicable, but given a different combination a result could have been calculated. For example, this might occur in a grid of results where the calculation requested for a column is not applicable for every row.


        public static final FailureReason UNSUPPORTED
        The operation requested is unsupported.

        The operation failed because it is not supported.


        public static final FailureReason MISSING_DATA
        The operation failed because data was missing.

        One or more pieces of data that the operation required were missing.


        public static final FailureReason CURRENCY_CONVERSION
        Currency conversion failed.

        This is used to indicate that the operation failed during currency conversion, perhaps due to missing FX rates.


        public static final FailureReason CALCULATION_FAILED
        The operation could not be performed.

        This is used to indicate that a calculation failed.

      • OTHER

        public static final FailureReason OTHER
        Failure occurred for some other reason.

        This reason should only be used when no other type is applicable. If using this reason, please consider raising an issue to get another more descriptive reason added.

    • Method Detail

      • values

        public static FailureReason[] 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 (FailureReason c : FailureReason.values())
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static FailureReason 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.)
        name - the name of the enum constant to be returned.
        the enum constant with the specified name
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • of

        public static FailureReason of​(String name)
        Obtains an instance from the specified name.

        Parsing handles the mixed case form produced by toString() and the upper and lower case variants of the enum constant name.

        name - the name to parse
        the type
        IllegalArgumentException - if the name is not known
      • toString

        public String toString()
        Returns the formatted name of the type.
        toString in class Enum<FailureReason>
        the formatted string representing the type