Package org.apache.ant.cyclonedx
Class EnumUtils
- java.lang.Object
-
- org.apache.ant.cyclonedx.EnumUtils
-
public class EnumUtils extends java.lang.ObjectHelpers for theEnumeratedAttributes wrapping enums in this package.
-
-
Constructor Summary
Constructors Constructor Description EnumUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E extends java.lang.Enum<E>>
EvalueOf(java.lang.Class<E> clazz, java.lang.String value, java.util.function.Function<E,java.lang.String> alternativeProvider)Maps a string to an enum value.static <E extends java.lang.Enum<E>>
java.lang.String[]valuesPlus(java.lang.Class<E> clazz, java.util.function.Function<E,java.lang.String> alternativeProvider)Provides strings that can be mapped to enum values unambiguously.
-
-
-
Method Detail
-
valuesPlus
public static <E extends java.lang.Enum<E>> java.lang.String[] valuesPlus(java.lang.Class<E> clazz, java.util.function.Function<E,java.lang.String> alternativeProvider)Provides strings that can be mapped to enum values unambiguously.- Type Parameters:
E- the enum type- Parameters:
clazz- the enum typealternativeProvider- a function generating alternative names for the enum constant- Returns:
- array of enum constants and alternative names for each constant.
-
valueOf
public static <E extends java.lang.Enum<E>> E valueOf(java.lang.Class<E> clazz, java.lang.String value, java.util.function.Function<E,java.lang.String> alternativeProvider) throws org.apache.tools.ant.BuildExceptionMaps a string to an enum value.- Type Parameters:
E- the enum type- Parameters:
clazz- the enum typevalue- the string to translatealternativeProvider- a function generating alternative names for the enum constant- Returns:
- the enum constant the string could be mapped to
- Throws:
java.lang.NullPointerException- if value is nullorg.apache.tools.ant.BuildException- if value can not be translated
-
-