public class

Enums

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

Class Overview

Utility code for enumerations (enum).

Summary

Nested Classes
@interface Enums.Value  
Public Constructors
Enums()
Public Methods
static <T extends Enum<T>> T fromValue(Class<? extends Enum<T>> c, int value)
Retrieve an enumerated constant by 'value'.
static <T extends Enum<T>> int getValue(Enum<T> e)
static <T extends Enum<T>> boolean isAnyOf(T e, T... values)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Enums ()

Public Methods

public static 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.

public static int getValue (Enum<T> e)

public static boolean isAnyOf (T e, T... values)

Parameters
e an enumerated constant
values a list of enums entries
Returns
  • true if `e` is found in the list of candidates, false otherwise