Package com.storedobject.common
Class Fault
java.lang.Object
com.storedobject.common.Fault
Represents a fault or error condition in the system.
This class provides methods to retrieve information about the fault, replace the fault message or code,
and append additional information to the fault message.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
static final Fault
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAppends a message to the existing fault message with a default separator.Appends the given message to the current message using the specified delimiter.int
getCode()
Retrieves the code value associated with this object.Retrieves the message associated with this method.boolean
Checks if this fault is categorized.boolean
Checks if this fault is technical.replace
(int code) Replaces the code of the Fault with the given code and returns the updated Fault object.Replaces the message of a Fault object.
-
Field Details
-
TECHNICAL_FAULT
-
UNCATEGORIZED_FAULT
-
ACCOUNT_ALREADY_EXISTS
-
ACCOUNT_NOT_FOUND
-
ACCOUNT_NOT_SPECIFIED
-
CUSTOMER_NOT_FOUND
-
NOT_A_CUSTOMER_ACCOUNT
-
NOT_A_LOAN_ACCOUNT
-
NOT_A_DEPOSIT_ACCOUNT
-
NOT_A_GL_ACCOUNT
-
INVALID_DATE
-
INVALID_PERIOD
-
INVALID_AMOUNT
-
INVALID_CURRENCY
-
TRANSACTION_APPROVAL_ERROR
-
TRANSACTION_NOT_BALANCED
-
TRANSACTION_NOT_FOUND
-
PARTIAL_TRANSACTION_COMMITTED
-
NOT_ENOUGH_BALANCE
-
EMPTY_NARRATION
-
VOUCHER_NOT_FOUND
-
ACTION_NOT_SPECIFIED
-
UNKNOWN_ACTION
-
DUPLICATE_ENTRY_FOUND
-
NO_ENTRIES_FOUND
-
MULTIPLE_ENTRIES_FOUND
-
DUPLICATE_REFERENCE_FOUND
-
REFERENCE_NOT_FOUND
-
REFERENCE_ALREADY_EXISTS
-
REFERENCE_NOT_SPECIFIED
-
NOT_ALLOWED
-
ILLEGAL_ACCESS
-
EXTERNAL_SYSTEM_NOT_RECOGNIZED
-
-
Constructor Details
-
Fault
Represents a fault with an error code and a descriptive message.- Parameters:
code
- the error code associated with the faultmessage
- the descriptive message of the fault
-
-
Method Details
-
getCode
public int getCode()Retrieves the code value associated with this object.- Returns:
- The code value.
-
getMessage
Retrieves the message associated with this method.- Returns:
- The message string.
-
replace
-
replace
Replaces the code of the Fault with the given code and returns the updated Fault object.- Parameters:
code
- the new code to be set in the Fault- Returns:
- the updated Fault object with the new code and the same message as the original Fault
-
append
-
append
Appends the given message to the current message using the specified delimiter.- Parameters:
message
- the message to be appendeddelimiter
- the delimiter to be used for joining the current message and the given message- Returns:
- a new Fault object with the updated message
-
isCategorized
public boolean isCategorized()Checks if this fault is categorized.- Returns:
true
if the fault is categorized,false
otherwise.
-
isTechnical
public boolean isTechnical()Checks if this fault is technical.- Returns:
- true if this is technical, false otherwise.
-