Package wbs.utils.util
Class WbsKeyed
java.lang.Object
wbs.utils.util.WbsKeyed
Quasi-extension to
WbsEnums for classes implementing Keyed, to allow more flexibility
in certain configurations.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Enum<T>>
TgetEnumFromKeyed(Class<T> clazz, String string) Gets the enum as represented by the given string.
-
Method Details
-
getEnumFromKeyed
Gets the enum as represented by the given string. Failing that, if the enum implements Keyed, it will attempt to find a key that is represented by the string.- Parameters:
clazz- The class of the enum to attempt to get a value from. May or may not extendKeyedstring- A string that may or may not represent a value of the enum, or the Keyed equivalent if that fails.- Returns:
- The value of the enum or Keyed field if it exists and is represented by the string.
-