MCPcopy Create free account
hub / github.com/apache/kudu / getTypeForName

Method getTypeForName

java/kudu-client/src/main/java/org/apache/kudu/Type.java:221–228  ·  view source on GitHub ↗

Create a Type from its name @param name The DataType name. It accepts Type name (from the getName() method) and ENUM name (from the name() method). @throws IllegalArgumentException if the provided name doesn't map to any known type. @return a matching Type.

(String name)

Source from the content-addressed store, hash-verified

219 * @return a matching Type.
220 */
221 public static Type getTypeForName(String name) {
222 for (Type t : values()) {
223 if (t.name().equals(name) || t.getName().equals(name)) {
224 return t;
225 }
226 }
227 throw new IllegalArgumentException("The provided name doesn't map to any known type: " + name);
228 }
229
230 /**
231 * @return true if this type has a pre-determined fixed size, false otherwise

Callers 1

testGetTypeForNameMethod · 0.95

Calls 4

valuesMethod · 0.80
equalsMethod · 0.45
nameMethod · 0.45
getNameMethod · 0.45

Tested by 1

testGetTypeForNameMethod · 0.76