MCPcopy Create free account
hub / github.com/BaseXdb/basex / get

Method get

basex-core/src/main/java/org/basex/util/Enums.java:28–33  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 12

getMethod · 0.95
toEnumMethod · 0.95
itemMethod · 0.95
toPermissionsMethod · 0.95
evalMethod · 0.95
duplicatesMethod · 0.95
getMethod · 0.95
DialogCsvParserMethod · 0.95
updateMethod · 0.95
parseMethod · 0.95
authHeadersMethod · 0.95
getMethod · 0.95

Calls 3

getMethod · 0.65
computeIfAbsentMethod · 0.45
toMapMethod · 0.45

Tested by

no test coverage detected