Class DefaultUnitsApiService
java.lang.Object
com.raynigon.unit.api.core.service.DefaultUnitsApiService
- All Implemented Interfaces:
UnitsApiService
,javax.measure.spi.SystemOfUnitsService
-
Constructor Summary
ModifierConstructorDescriptionprotected
DefaultUnitsApiService
(Set<javax.measure.spi.SystemOfUnits> systems) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSystemOfUnits
(javax.measure.spi.SystemOfUnits system) Adds an additionalSystemOfUnits
to the UnitsApiService.<Q extends javax.measure.Quantity<Q>>
javax.measure.Quantity<Q>createQuantity
(@NotNull Number value, @NotNull javax.measure.Unit<Q> unit) @NotNull String
format
(javax.measure.Quantity<?> quantity) Collection<javax.measure.spi.SystemOfUnits>
static UnitsApiService
javax.measure.spi.SystemOfUnits
javax.measure.spi.SystemOfUnits
getSystemOfUnits
(String name) <T extends javax.measure.Quantity<T>>
@NotNull javax.measure.Unit<T>@NotNull javax.measure.Unit<?>
@NotNull javax.measure.Quantity<?>
parseQuantity
(@NotNull String quantity) static UnitsApiService
replaceInstance
(UnitsApiService other) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.measure.spi.SystemOfUnitsService
getPrefixes
Methods inherited from interface com.raynigon.unit.api.core.service.UnitsApiService
defaultReader, defaultWriter
-
Constructor Details
-
DefaultUnitsApiService
public DefaultUnitsApiService() -
DefaultUnitsApiService
-
-
Method Details
-
getInstance
-
replaceInstance
-
getSystemOfUnits
public javax.measure.spi.SystemOfUnits getSystemOfUnits()- Specified by:
getSystemOfUnits
in interfacejavax.measure.spi.SystemOfUnitsService
-
getSystemOfUnits
- Specified by:
getSystemOfUnits
in interfacejavax.measure.spi.SystemOfUnitsService
-
getAvailableSystemsOfUnits
- Specified by:
getAvailableSystemsOfUnits
in interfacejavax.measure.spi.SystemOfUnitsService
-
addSystemOfUnits
public void addSystemOfUnits(javax.measure.spi.SystemOfUnits system) Description copied from interface:UnitsApiService
Adds an additionalSystemOfUnits
to the UnitsApiService. The Name provided by theSystemOfUnits
is used as an id and therefore has to be unique.- Specified by:
addSystemOfUnits
in interfaceUnitsApiService
- Parameters:
system
- the additionalSystemOfUnits
-
getUnit
@NotNull public <T extends javax.measure.Quantity<T>> @NotNull javax.measure.Unit<T> getUnit(@NotNull @NotNull Class<T> quantityType) - Specified by:
getUnit
in interfaceUnitsApiService
-
getUnit
- Specified by:
getUnit
in interfaceUnitsApiService
-
format
- Specified by:
format
in interfaceUnitsApiService
-
parseQuantity
- Specified by:
parseQuantity
in interfaceUnitsApiService
-
createQuantity
public <Q extends javax.measure.Quantity<Q>> javax.measure.Quantity<Q> createQuantity(@NotNull @NotNull Number value, @NotNull @NotNull javax.measure.Unit<Q> unit) - Specified by:
createQuantity
in interfaceUnitsApiService
-