Class Enums

java.lang.Object
com.pnfsoftware.jeb.util.base.Enums

public class Enums extends Object
Utility code for enumerations (enum).
  • Constructor Details

    • Enums

      public Enums()
  • Method Details

    • getValue

      public static <T extends Enum<T>> int getValue(Enum<T> e)
      Type Parameters:
      T -
      Parameters:
      e -
      Returns:
    • fromValue

      public static <T extends Enum<T>> T fromValue(Class<? extends Enum<T>> c, int value)
      Retrieve an enumerated constant by 'value'. The value - not be confused with the ordinal - are provided to enum fields by the Enums.Value annotation.
      Type Parameters:
      T -
      Parameters:
      c -
      value -
      Returns:
    • isAnyOf

      @SafeVarargs public static <T extends Enum<T>> boolean isAnyOf(T e, T... values)
      Type Parameters:
      T -
      Parameters:
      e - an enumerated constant
      values - a list of enums entries
      Returns:
      true if `e` is found in the list of candidates, false otherwise