Class ProxyQuantityFactory.Default<Q extends javax.measure.Quantity<Q>>

java.lang.Object
tech.units.indriya.quantity.ProxyQuantityFactory<Q>
tech.units.indriya.quantity.ProxyQuantityFactory.Default<Q>
Type Parameters:
Q - The type of the quantity
All Implemented Interfaces:
javax.measure.spi.QuantityFactory<Q>
Enclosing class:
ProxyQuantityFactory<Q extends javax.measure.Quantity<Q>>

private static final class ProxyQuantityFactory.Default<Q extends javax.measure.Quantity<Q>> extends ProxyQuantityFactory<Q>
The default factory implementation. This factory uses reflection for providing a default implementation for every
invalid reference
AbstractMeasurement
sub-types.
  • Field Details

    • type

      private final Class<Q extends javax.measure.Quantity<Q>> type
      The type of the quantities created by this factory.
    • metricUnit

      private final javax.measure.Unit<Q extends javax.measure.Quantity<Q>> metricUnit
      The metric unit for quantities created by this factory.
    • CLASS_TO_METRIC_UNIT

      static final HashMap<Class,javax.measure.Unit> CLASS_TO_METRIC_UNIT
  • Constructor Details

    • Default

      Default(Class<Q> type)
      Creates a new factory for quantities of the given type.
      Parameters:
      type - The type of the quantities created by this factory.
  • Method Details

    • getSystemUnit

      public javax.measure.Unit<Q> getSystemUnit()
      Description copied from class: ProxyQuantityFactory
      Returns the metric unit for quantities produced by this factory or null if unknown.
      Specified by:
      getSystemUnit in interface javax.measure.spi.QuantityFactory<Q extends javax.measure.Quantity<Q>>
      Specified by:
      getSystemUnit in class ProxyQuantityFactory<Q extends javax.measure.Quantity<Q>>
      Returns:
      the metric units for this factory quantities.
    • create

      public javax.measure.Quantity<Q> create(Number value, javax.measure.Unit<Q> unit)