Returns the specified enum value. @param enum value @param type enum class @param value value to be found @return enum or null
(final Class<V> type, final String value)
| 26 | * @return enum or {@code null} |
| 27 | */ |
| 28 | public static <V extends Enum<V>> V get(final Class<V> type, final String value) { |
| 29 | @SuppressWarnings("unchecked") |
| 30 | final Map<String, V> map = (Map<String, V>) CACHE.computeIfAbsent(type, k -> Arrays.stream( |
| 31 | type.getEnumConstants()).collect(Collectors.toMap(Enum::toString, t -> t, (f, s) -> f))); |
| 32 | return map.get(value); |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Checks if this is one of the specified errors. |
no test coverage detected