Class ErrorCode
java.lang.Object
com.motivewave.platform.sdk.common.ErrorCode
- All Implemented Interfaces:
Serializable
,Comparable
Encapsulates a message ID and the resource bundle used to resolve the locale dependent message.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Warning: this method does not support localization.boolean
Compares this object with another ErrorMsg.get()
Gets the locale dependent message using the US localeGets the locale dependent message using the US locale (with the given string substitutions)Gets the locale dependent message for the default locale.getID()
Gets the message ID.toString()
Formats this object as a String.final void
Convenience method.
-
Constructor Details
-
ErrorCode
Constructs an error message with the given bundle name.- Parameters:
ID
- error idrb
- resource bundle name
-
-
Method Details
-
compareTo
Warning: this method does not support localization.- Specified by:
compareTo
in interfaceComparable
- Parameters:
o
- object to compare to- Returns:
- result of the comparison between this string, and the input, according to the default locale.
-
equals
Compares this object with another ErrorMsg. -
get
Gets the locale dependent message for the default locale. The occurences of %x are replace by the given parameters. If one of the paramaters is a MsgID, it will be localized (usingget(Locale, Object...)
before using it as the argument to the current message.- Parameters:
locale
- The locale for this message.params
- An array of parameters for the message.- Returns:
- The message.
-
get
Gets the locale dependent message using the US locale- Returns:
- the local dependent message
-
get
Gets the locale dependent message using the US locale (with the given string substitutions)- Parameters:
params
- parameter substitutions for {0}, {1} etc- Returns:
- the local dependent message
-
write
Convenience method. Gets the locale dependent message for the default locale. The occurrences of {x} are replace by the given parameters.- Parameters:
out
- output streamlocale
- The locale for this message.params
- An array of parameters for the message.- Throws:
IOException
- if an error occurs
-
getID
Gets the message ID.- Returns:
- the ID
-
getResource
-
toString
Formats this object as a String. Returns the same value as getID().
-