- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- life.expert.value.numeric.utils.ValueException
-
- life.expert.value.numeric.utils.UnknownUnitException
-
- All Implemented Interfaces:
java.io.Serializable
public class UnknownUnitException extends ValueException
Exception thrown when a unit code cannot be resolved into aUnit.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UnknownUnitException(java.lang.String code)Creates a new exception instance when aUnitcould not be evaluated given a unit code.UnknownUnitException(java.util.Locale locale)Creates a new exception instance when aUnitcould not be evaluated given a (country)Locale.
-
Method Summary
Modifier and Type Method Description java.lang.StringgetCurrencyCode()Access the invalid currency code.java.util.LocalegetLocale()Access the invalidLocale.java.lang.StringtoString()
-
-
-
Constructor Detail
-
UnknownUnitException
public UnknownUnitException(java.lang.String code)
Creates a new exception instance when aUnitcould not be evaluated given a unit code.- Parameters:
code- The unknown currency code (the message is constructed automatically), not null.- See Also:
Piece#getCode()
-
UnknownUnitException
public UnknownUnitException(java.util.Locale locale)
Creates a new exception instance when aUnitcould not be evaluated given a (country)Locale.- Parameters:
locale- The unknownLocale, for which aUnitwas queried (the message is constructed automatically), not null.- See Also:
Piece#getCode()
-
-
Method Detail
-
getCurrencyCode
public java.lang.String getCurrencyCode()
Access the invalid currency code.- Returns:
- the invalid currency code, or
null.
-
getLocale
public java.util.Locale getLocale()
Access the invalidLocale.- Returns:
- the invalid
Locale, ornull.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Throwable
-
-