Package org.tquadrat.foundation.value
Class PowerValueStringConverter
java.lang.Object
org.tquadrat.foundation.value.api.DimensionedValueStringConverter<Power,PowerValue>
org.tquadrat.foundation.value.PowerValueStringConverter
- All Implemented Interfaces:
Serializable
,StringConverter<PowerValue>
@ClassVersion(sourceVersion="$Id: PowerValueStringConverter.java 1073 2023-10-01 11:08:51Z tquadrat $")
@API(status=STABLE,
since="0.1.0")
public class PowerValueStringConverter
extends DimensionedValueStringConverter<Power,PowerValue>
The implementation of
StringConverter
for
PowerValue
instances.- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: PowerValueStringConverter.java 1073 2023-10-01 11:08:51Z tquadrat $
- Since:
- 0.1.0
- See Also:
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.value.PowerValueStringConverter"
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PowerValueStringConverter
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 ofPowerValueStringConverter
. -
Method Summary
Modifier and TypeMethodDescriptionprotected final PowerValue
createValue
(BigDecimal number, Power dimension) Creates an instance ofDimensionedValue
from the given arguments.static final PowerValueStringConverter
provider()
This method is used by theServiceLoader
to obtain the instance for thisStringConverter
implementation.protected Power
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
-
PowerValueStringConverter
public PowerValueStringConverter()Creates a new instance ofPowerValueStringConverter
.
-
-
Method Details
-
createValue
Creates an instance ofDimensionedValue
from the given arguments.- Specified by:
createValue
in classDimensionedValueStringConverter<Power,
PowerValue> - 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<Power,
PowerValue> - Parameters:
symbol
- The unit symbol.- Returns:
- The unit instance.
-