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 Type
    Method
    Description
    void
    addSystemOfUnits(javax.measure.spi.SystemOfUnits system)
    Adds an additional SystemOfUnits to the UnitsApiService.
    <Q extends javax.measure.Quantity<Q>>
    javax.measure.Quantity<Q>
    createQuantity(@NotNull Number number, @NotNull javax.measure.Unit<Q> unit)
     
    default @NotNull QuantityReader
     
    default @NotNull QuantityWriter
     
    @NotNull String
    format(@NotNull javax.measure.Quantity<?> quantity)
     
    static @NotNull UnitsApiService
     
    @NotNull javax.measure.Unit<?>
    getUnit(@NotNull String symbol)
     
    <T extends javax.measure.Quantity<T>>
    @NotNull javax.measure.Unit<T>
    getUnit(Class<T> quantityType)
     
    @NotNull javax.measure.Quantity<?>
    parseQuantity(@NotNull String quantity)
     
    static <Q extends javax.measure.Quantity<Q>>
    @NotNull javax.measure.Quantity<Q>
    quantity(@NotNull Number number, @NotNull javax.measure.Unit<Q> unit)
     
    static @NotNull javax.measure.Quantity<?>
    quantity(@NotNull String quantity)
    Deprecated.
    static @NotNull QuantityReader
     
    static <T extends javax.measure.Quantity<T>>
    @NotNull javax.measure.Unit<T>
    unit(@NotNull Class<T> quantityType)
     
    static @NotNull javax.measure.Unit<?>
    unit(@NotNull String symbol)
     
    static @NotNull QuantityWriter
     

    Methods inherited from interface javax.measure.spi.SystemOfUnitsService

    getAvailableSystemsOfUnits, getPrefixes, getSystemOfUnits, getSystemOfUnits
  • Method Details

    • getInstance

      @NotNull static @NotNull UnitsApiService getInstance()
    • unit

      @NotNull static <T extends javax.measure.Quantity<T>> @NotNull javax.measure.Unit<T> unit(@NotNull @NotNull Class<T> quantityType)
    • unit

      @NotNull static @NotNull javax.measure.Unit<?> unit(@NotNull @NotNull String symbol)
    • quantity

      @Deprecated @NotNull static @NotNull javax.measure.Quantity<?> quantity(@NotNull @NotNull String quantity)
      Deprecated.
    • reader

      @NotNull static @NotNull QuantityReader reader()
    • writer

      @NotNull static @NotNull QuantityWriter 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 additional SystemOfUnits to the UnitsApiService. The Name provided by the SystemOfUnits is used as an id and therefore has to be unique.
      Parameters:
      system - the additional SystemOfUnits
    • 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

      @NotNull @NotNull String format(@NotNull @NotNull javax.measure.Quantity<?> quantity)
    • parseQuantity

      @NotNull @NotNull javax.measure.Quantity<?> parseQuantity(@NotNull @NotNull String quantity)
    • createQuantity

      <Q extends javax.measure.Quantity<Q>> javax.measure.Quantity<Q> createQuantity(@NotNull @NotNull Number number, @NotNull @NotNull javax.measure.Unit<Q> unit)
    • defaultReader

      @NotNull default @NotNull QuantityReader defaultReader()
    • defaultWriter

      @NotNull default @NotNull QuantityWriter defaultWriter()