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

Method value

basex-core/src/main/java/org/basex/util/XMLAccess.java:90–98  ·  view source on GitHub ↗

Returns an enum instance for the requested value. @param prefix error prefix @param name name @param names allowed names @param token type @return enum @throws BaseXException database exception

(final String prefix, final byte[] name, final E[] names)

Source from the content-addressed store, hash-verified

88 * @throws BaseXException database exception
89 */
90 public static <E extends Enum<E>> E value(final String prefix, final byte[] name, final E[] names)
91 throws BaseXException {
92
93 final String n = string(name);
94 for(final E nm : names) {
95 if(nm.toString().equals(n)) return nm;
96 }
97 throw new BaseXException("%: Unexpected element: \"%\".", prefix, name);
98 }
99}

Callers 1

attributeMethod · 0.95

Calls 3

toStringMethod · 0.65
stringMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected