Checks if this is one of the specified errors. @param enum value @param value value to be found @param candidates candidates @return result of check
(final V value, final V... candidates)
| 40 | * @return result of check |
| 41 | */ |
| 42 | @SafeVarargs |
| 43 | public static <V extends Enum<V>> boolean oneOf(final V value, final V... candidates) { |
| 44 | for(final V c : candidates) { |
| 45 | if(value == c) return true; |
| 46 | } |
| 47 | return false; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Helper function for converting enumeration names to strings. |