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)
| 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 |