Class WbsKeyed

java.lang.Object
wbs.utils.util.WbsKeyed

public abstract class WbsKeyed extends Object
Quasi-extension to WbsEnums for classes implementing Keyed, to allow more flexibility in certain configurations.
  • Method Details

    • getEnumFromKeyed

      public static <T extends Enum<T>> T getEnumFromKeyed(Class<T> clazz, String string)
      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 extend Keyed
      string - 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.