Enum FailureReason

  • All Implemented Interfaces:
    Named, NamedEnum, java.io.Serializable, java.lang.Comparable<FailureReason>

    public enum FailureReason
    extends java.lang.Enum<FailureReason>
    implements NamedEnum
    Represents the reason why failure occurred.

    Each failure is categorized as one of the following reasons.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CALCULATION_FAILED
      The operation could not be performed.
      CURRENCY_CONVERSION
      Currency conversion failed.
      ERROR
      An error occurred.
      INVALID
      The input was invalid.
      MISSING_DATA
      The operation failed because data was missing.
      MULTIPLE
      There were multiple failures of different types.
      NOT_APPLICABLE
      The operation requested was not applicable.
      OTHER
      Failure occurred for some other reason.
      PARSING
      A parsing error occurred.
      UNSUPPORTED
      The operation requested is unsupported.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static FailureReason of​(java.lang.String name)
      Obtains an instance from the specified name.
      java.lang.String toString()
      Returns the formatted name of the type.
      static FailureReason valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static FailureReason[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.opengamma.strata.collect.named.NamedEnum

        getName
    • 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.

      • NOT_APPLICABLE

        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.

      • UNSUPPORTED

        public static final FailureReason UNSUPPORTED
        The operation requested is unsupported.

        The operation failed because it is not supported.

      • MISSING_DATA

        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.

      • CURRENCY_CONVERSION

        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.

      • CALCULATION_FAILED

        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())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static FailureReason valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • of

        public static FailureReason of​(java.lang.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.

        Parameters:
        name - the name to parse
        Returns:
        the type
        Throws:
        java.lang.IllegalArgumentException - if the name is not known
      • toString

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