Class NfbRuntimeException.Code

java.lang.Object
com.nfbsoftware.exception.NfbRuntimeException.Code
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
XmlDocumentRuntimeException.Code
Enclosing class:
NfbRuntimeException

protected static class NfbRuntimeException.Code extends Object implements Serializable
Represents a runtimeException code. This class is used to enforce the practice of using a code defined for this exception class. Instances of the exception cannot be constructed without providing a valid code. Subclasses of this class must implement a subclass of this protected class. Typically, subclass constructors will take this Code subclass in an internal Codes interface.
Author:
Brendan Clemenzi
See Also:
  • Constructor Details

    • Code

      protected Code(String code, NfbRuntimeException.Code mappedCode, String message)
      The protected constructor ensures that no instances of this class are constructed outside of the exception class or its children.
      Parameters:
      code - the code
      mappedCode - the top-level code that this code should map to
      message - the default message
  • Method Details

    • getCode

      public String getCode()
      Returns the code's value
      Returns:
      the code's value
    • getMappedCode

      public NfbRuntimeException.Code getMappedCode()
      Returns the code's mapped code
      Returns:
      the code's mapped code value
    • getMessage

      public String getMessage()
      Returns the code's default message.
      Returns:
      the code's default message
    • toString

      public String toString()
      Returns the Code's value as a String.
      Overrides:
      toString in class Object
      Returns:
      the code's value