public class BigDecType extends BaseValueType<BigDecimal>
BigDecimal type.
This class is threadsafe and uses a singleton pattern to prevent multiple instances, since all users can safely share the same instance.
clazzType| Modifier | Constructor and Description |
|---|---|
protected |
BigDecType() |
| Modifier and Type | Method and Description |
|---|---|
BigDecimal |
cast(Object o)
Attempt to cast the object to the generic type T, which is a concrete class in subclasses.
|
static BigDecType |
instance()
Fetch the single, shared instace of this ValueType
|
BigDecimal |
parse(String sourceValue)
Parses a String to a
BigDecType. |
getDestinationType, toStringpublic static BigDecType instance()
BigDecType()public BigDecimal parse(String sourceValue) throws ParsingException
BigDecType. The String should already be trimmed.
Parsing is done by calling the BigDecimal.BigDecimal(String) constructor,
which accepts many different forms - refer there for valid String formats.
sourceValue - The source string, which should already be trimmed and may be nullParsingException - if unparsable.public BigDecimal cast(Object o) throws RuntimeException
ValueTypeAndHow uses this internally to cast values known to already be of type T, but were stored in a generic way. If used for unknown types that are not castable to T, it will throw a RuntimeException, though this should never happen unless used by application code.
o - Object to castRuntimeExceptionCopyright © 2022. All rights reserved.