Class EnumFormatter<E extends java.lang.Enum<E>>
- java.lang.Object
-
- aQute.bnd.build.model.conversions.EnumFormatter<E>
-
-
Field Summary
Fields Modifier and Type Field Description private E
defaultValue
-
Constructor Summary
Constructors Modifier Constructor Description private
EnumFormatter(E defaultValue)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
convert(E input)
static <E extends java.lang.Enum<E>>
EnumFormatter<E>create(java.lang.Class<E> enumType)
Construct a new formatter with no default value, i.e.static <E extends java.lang.Enum<E>>
EnumFormatter<E>create(java.lang.Class<E> enumType, E defaultValue)
Construct a new formatter with the specified default value.java.lang.String
error(java.lang.String msg)
-
-
-
Constructor Detail
-
EnumFormatter
private EnumFormatter(E defaultValue)
-
-
Method Detail
-
create
public static <E extends java.lang.Enum<E>> EnumFormatter<E> create(java.lang.Class<E> enumType)
Construct a new formatter with no default value, i.e. any non-null value of the enum will print that value.- Parameters:
enumType
- The enum type.
-
create
public static <E extends java.lang.Enum<E>> EnumFormatter<E> create(java.lang.Class<E> enumType, E defaultValue)
Construct a new formatter with the specified default value.- Parameters:
enumType
- The enum type.defaultValue
- The default value, which will never be output.
-
convert
public java.lang.String convert(E input) throws java.lang.IllegalArgumentException
-
-