Package com.earth2me.essentials.utils
Class EnumUtil
java.lang.Object
com.earth2me.essentials.utils.EnumUtil
-
Method Summary
Modifier and TypeMethodDescriptiongetAllMatching
(Class<T> enumClass, String... names) Return a set containing all fields of the given enum that match one of the provided names.static EntityType
getEntityType
(String... names) static Material
getMaterial
(String... names) Gets the first Material field found from the given names.static Statistic
getStatistic
(String... names) Gets the first Statistic field found from the given names.static <T extends Enum<T>>
TReturns the field matching the first provided enum name that exists within the given enum class.
-
Method Details
-
valueOf
Returns the field matching the first provided enum name that exists within the given enum class. If no field is found, this method returns null.- Type Parameters:
T
- The enum to search through- Parameters:
enumClass
- The class to search throughnames
- The names of the fields to search for- Returns:
- The first matching enum field
-
getAllMatching
Return a set containing all fields of the given enum that match one of the provided names.- Type Parameters:
T
- The enum to search through- Parameters:
enumClass
- The class to search throughnames
- The names of the fields to search for- Returns:
- All matching enum fields
-
getMaterial
Gets the first Material field found from the given names.- Parameters:
names
- The names of the fields to search for- Returns:
- The first matching Material
-
getStatistic
Gets the first Statistic field found from the given names.- Parameters:
names
- The names of the fields to search for- Returns:
- The first matching Statistic
-
getEntityType
-