Enum UnitStyle

java.lang.Object
java.lang.Enum<UnitStyle>
tech.units.indriya.format.UnitStyle
All Implemented Interfaces:
Serializable, Comparable<UnitStyle>

public enum UnitStyle extends Enum<UnitStyle>
Defines the different variants of unit formatting.
Since:
1.0.1
Version:
1.0
  • Enum Constant Details

    • NAME

      public static final UnitStyle NAME
      The unit will be rendered as its name.
      See Also:
      • Unit.getName()
    • SYMBOL

      public static final UnitStyle SYMBOL
      The unit will be rendered as its symbol.
      See Also:
      • Unit.getSymbol()
    • LABEL

      public static final UnitStyle LABEL
      The unit will be rendered as its label.
      See Also:
      • invalid reference
        javax.measure.format.UnitFormat#label()
    • SYMBOL_AND_LABEL

      public static final UnitStyle SYMBOL_AND_LABEL
      The unit will be rendered as its symbol and also labeled.
      See Also:
      • Unit.getSymbol()
      • invalid reference
        javax.measure.format.UnitFormat#label()
  • Constructor Details

    • UnitStyle

      private UnitStyle()
  • Method Details

    • values

      public static UnitStyle[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static UnitStyle valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null