Module org.tquadrat.foundation.util
Class CurrencyStringConverter
java.lang.Object
org.tquadrat.foundation.util.stringconverter.CurrencyStringConverter
- All Implemented Interfaces:
Serializable,StringConverter<Currency>
@ClassVersion(sourceVersion="$Id: CurrencyStringConverter.java 1060 2023-09-24 19:21:40Z tquadrat $")
@API(status=STABLE,
since="0.1.0")
public final class CurrencyStringConverter
extends Object
implements StringConverter<Currency>
An implementation of
StringConverter
for
Currency
values.
The method
fromString(CharSequence)
will use
Currency.getInstance(String)
to retrieve a Currency based on the given ISO 4217 code.}.
The method
toString(Currency)
will use
Currency.getCurrencyCode()
to return the ISO 4217 code to the given Currency
instance.
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: CurrencyStringConverter.java 1060 2023-09-24 19:21:40Z tquadrat $
- Since:
- 0.0.6
- See Also:
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.util.stringconverter.CurrencyStringConverter"
-
Field Summary
FieldsFields inherited from interface org.tquadrat.foundation.lang.StringConverter
METHOD_NAME_GetSubjectClass, METHOD_NAME_Provider -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance ofCurrencyStringConverter. -
Method Summary
Modifier and TypeMethodDescriptionfinal CurrencyfromString(CharSequence source) static final CurrencyStringConverterprovider()This method is used by theServiceLoaderto obtain the instance for thisStringConverterimplementation.final String
-
Field Details
-
INSTANCE
An instance of this class.
-
-
Constructor Details
-
CurrencyStringConverter
public CurrencyStringConverter()Creates a new instance ofCurrencyStringConverter.
-
-
Method Details
-
fromString
- Specified by:
fromStringin interfaceStringConverter<Currency>- Throws:
IllegalArgumentException
-
provider
This method is used by theServiceLoaderto obtain the instance for thisStringConverterimplementation.- Returns:
- The instance for this
StringConverterimplementation.
-
toString
- Specified by:
toStringin interfaceStringConverter<Currency>
-
