Interface UnitBuilder.UnitConstructorFunction<U extends Unit>

Type Parameters:
U - the type of the unit
Enclosing class:
UnitBuilder<U extends Unit>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

A functional interface for constructing new units without relying on reflection.
  • Method Summary

    Modifier and Type
    Method
    Description
    create(U baseUnit, UnaryFunction toBaseUnits, UnaryFunction fromBaseUnits, String name, String symbol)
    Creates a new unit instance based on its relation to the base unit of measure.
  • Method Details

    • create

      U create(U baseUnit, UnaryFunction toBaseUnits, UnaryFunction fromBaseUnits, String name, String symbol)
      Creates a new unit instance based on its relation to the base unit of measure.
      Parameters:
      baseUnit - the base unit of the unit system
      toBaseUnits - a function that converts values of the new unit to equivalent values in terms of the base unit
      fromBaseUnits - a function that converts values in the base unit to equivalent values in terms of the new unit
      name - the name of the new unit
      symbol - the shorthand symbol of the new unit
      Returns:
      a new unit