Package org.tquadrat.foundation.value
Class LengthValueStringConverter
java.lang.Object
org.tquadrat.foundation.value.api.DimensionedValueStringConverter<Length,LengthValue>
org.tquadrat.foundation.value.LengthValueStringConverter
- All Implemented Interfaces:
Serializable
,StringConverter<LengthValue>
@ClassVersion(sourceVersion="$Id: LengthValueStringConverter.java 1072 2023-09-30 20:44:38Z tquadrat $")
@API(status=STABLE,
since="0.1.0")
public class LengthValueStringConverter
extends DimensionedValueStringConverter<Length,LengthValue>
The implementation of
StringConverter
for
LengthValue
instances.- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: LengthValueStringConverter.java 1072 2023-09-30 20:44:38Z tquadrat $
- Since:
- 0.1.0
- See Also:
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.value.LengthValueStringConverter"
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LengthValueStringConverter
An instance of this class.Fields inherited from class org.tquadrat.foundation.value.api.DimensionedValueStringConverter
MSG_InvalidValue
Fields inherited from interface org.tquadrat.foundation.lang.StringConverter
METHOD_NAME_GetSubjectClass, METHOD_NAME_Provider
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance ofLengthValueStringConverter
. -
Method Summary
Modifier and TypeMethodDescriptionprotected final LengthValue
createValue
(BigDecimal number, Length dimension) Creates an instance ofDimensionedValue
from the given arguments.static final LengthValueStringConverter
provider()
This method is used by theServiceLoader
to obtain the instance for thisStringConverter
implementation.protected Length
unitFromSymbol
(String symbol) Determines the unit instance from the given unit symbol.Methods inherited from class org.tquadrat.foundation.value.api.DimensionedValueStringConverter
fromString, getSubjectClass, toString, toString
-
Field Details
-
INSTANCE
An instance of this class.
-
-
Constructor Details
-
LengthValueStringConverter
public LengthValueStringConverter()Creates a new instance ofLengthValueStringConverter
.
-
-
Method Details
-
createValue
Creates an instance ofDimensionedValue
from the given arguments.- Specified by:
createValue
in classDimensionedValueStringConverter<Length,
LengthValue> - Parameters:
number
- The value.dimension
- The dimension.- Returns:
- The dimensioned value.
-
provider
This method is used by theServiceLoader
to obtain the instance for thisStringConverter
implementation.- Returns:
- The instance for this
StringConverter
implementation.
-
unitFromSymbol
Determines the unit instance from the given unit symbol.- Specified by:
unitFromSymbol
in classDimensionedValueStringConverter<Length,
LengthValue> - Parameters:
symbol
- The unit symbol.- Returns:
- The unit instance.
-