Class IntegerStringConverter
java.lang.Object
org.tquadrat.foundation.util.stringconverter.NumberStringConverter<Integer>
org.tquadrat.foundation.util.stringconverter.IntegerStringConverter
- All Implemented Interfaces:
Serializable, StringConverter<Integer>
@ClassVersion(sourceVersion="$Id: IntegerStringConverter.java 1060 2023-09-24 19:21:40Z tquadrat $")
@API(status=STABLE,
since="0.0.6")
public final class IntegerStringConverter
extends NumberStringConverter<Integer>
The implementation of
NumberStringConverter
Integer.- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: IntegerStringConverter.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.IntegerStringConverter"
-
Field Summary
FieldsFields inherited from class NumberStringConverter
MSG_InvalidNumberFormatFields inherited from interface StringConverter
METHOD_NAME_GetSubjectClass, METHOD_NAME_Provider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final IntegerparseNumber(String value) Parses the given String to a number.static final IntegerStringConverterprovider()This method is used by theServiceLoaderto obtain the instance for thisStringConverterimplementation.Methods inherited from class NumberStringConverter
fromString, getSubjectClassMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface StringConverter
toString
-
Field Details
-
INSTANCE
An instance of this class.
-
-
Constructor Details
-
IntegerStringConverter
public IntegerStringConverter()Creates a new instance ofIntegerStringConverter.
-
-
Method Details
-
parseNumber
Parses the given String to a number. The String is notnull, not empty, and it will not contain blanks only. Leading or trailing blanks have been cut off.- Specified by:
parseNumberin classNumberStringConverter<Integer>- Parameters:
value- The String to parse.- Returns:
- The number.
- Throws:
NumberFormatException- The given value cannot be parsed to a number.
-
provider
This method is used by theServiceLoaderto obtain the instance for thisStringConverterimplementation.- Returns:
- The instance for this
StringConverterimplementation.
-
