Package tech.units.indriya.format
Enum UnitStyle
- java.lang.Object
-
- java.lang.Enum<UnitStyle>
-
- tech.units.indriya.format.UnitStyle
-
-
Enum Constant Summary
Enum Constants Enum Constant Description LABEL
The unit will be rendered as its label.NAME
The unit will be rendered as its name.SYMBOL
The unit will be rendered as its symbol.SYMBOL_AND_LABEL
The unit will be rendered as its symbol and also labeled.
-
Constructor Summary
Constructors Modifier Constructor Description private
UnitStyle()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static UnitStyle
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static UnitStyle[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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:
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()
,javax.measure.format.UnitFormat#label()
-
-
Method Detail
-
values
public static UnitStyle[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (UnitStyle c : UnitStyle.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static UnitStyle valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-