Interface UnitsApiService
- All Superinterfaces:
javax.measure.spi.SystemOfUnitsService
- All Known Implementing Classes:
DefaultUnitsApiService
public interface UnitsApiService
extends javax.measure.spi.SystemOfUnitsService
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddSystemOfUnits(javax.measure.spi.SystemOfUnits system) Adds an additionalSystemOfUnitsto the UnitsApiService.<Q extends javax.measure.Quantity<Q>>
javax.measure.Quantity<Q>createQuantity(@NotNull Number number, @NotNull javax.measure.Unit<Q> unit) default @NotNull QuantityReaderdefault @NotNull QuantityWriter@NotNull Stringformat(@NotNull javax.measure.Quantity<?> quantity) static @NotNull UnitsApiService@NotNull javax.measure.Unit<?><T extends javax.measure.Quantity<T>>
@NotNull javax.measure.Unit<T>@NotNull javax.measure.Quantity<?>parseQuantity(@NotNull String quantity) static <Q extends javax.measure.Quantity<Q>>
@NotNull javax.measure.Quantity<Q>static @NotNull javax.measure.Quantity<?>Deprecated.static @NotNull QuantityReaderreader()static <T extends javax.measure.Quantity<T>>
@NotNull javax.measure.Unit<T>static @NotNull javax.measure.Unit<?>static @NotNull QuantityWriterwriter()Methods inherited from interface javax.measure.spi.SystemOfUnitsService
getAvailableSystemsOfUnits, getPrefixes, getSystemOfUnits, getSystemOfUnits
-
Method Details
-
getInstance
-
unit
@NotNull static <T extends javax.measure.Quantity<T>> @NotNull javax.measure.Unit<T> unit(@NotNull @NotNull Class<T> quantityType) -
unit
-
quantity
@Deprecated @NotNull static @NotNull javax.measure.Quantity<?> quantity(@NotNull @NotNull String quantity) Deprecated. -
reader
-
writer
-
quantity
@NotNull static <Q extends javax.measure.Quantity<Q>> @NotNull javax.measure.Quantity<Q> quantity(@NotNull @NotNull Number number, @NotNull @NotNull javax.measure.Unit<Q> unit) -
addSystemOfUnits
void addSystemOfUnits(javax.measure.spi.SystemOfUnits system) Adds an additionalSystemOfUnitsto the UnitsApiService. The Name provided by theSystemOfUnitsis used as an id and therefore has to be unique.- Parameters:
system- the additionalSystemOfUnits
-
getUnit
@NotNull <T extends javax.measure.Quantity<T>> @NotNull javax.measure.Unit<T> getUnit(Class<T> quantityType) throws UnitNotFoundException - Throws:
UnitNotFoundException
-
getUnit
@NotNull @NotNull javax.measure.Unit<?> getUnit(@NotNull @NotNull String symbol) throws UnitNotFoundException - Throws:
UnitNotFoundException
-
format
-
parseQuantity
-
createQuantity
<Q extends javax.measure.Quantity<Q>> javax.measure.Quantity<Q> createQuantity(@NotNull @NotNull Number number, @NotNull @NotNull javax.measure.Unit<Q> unit) -
defaultReader
-
defaultWriter
-