Class Enums

java.lang.Object
eu.bandm.tools.util.java.Enums

public final class Enums extends Object
Library of constants and combinators for classes implementing Enum.
  • Method Details

    • getMap

      @Deprecated(forRemoval=true) public static <E extends Enum<E>> Map<String,E> getMap(Class<E> cls)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • valueMap

      public static <E extends Enum<E>> Map<String,E> valueMap(Class<E> cls)
      Create a map of all items of the given enumeration class, indexed by their name.
    • valueMap

      public static <E extends Enum<E>> Map<String,E> valueMap(E[] items)
      Create a map of the given enumeration items by their name. The list of items can be get statically by »classname.values()« (Java language spec 8.9.3) or by reflection from the class reification.