Gets the ToolType for the specified name, or creates a new one if none for that name does yet exist. This method can be called during parallel loading
(String name)
| 38 | * This method can be called during parallel loading |
| 39 | */ |
| 40 | public static ToolType get(String name) |
| 41 | { |
| 42 | return VALUES.computeIfAbsent(name, k -> |
| 43 | { |
| 44 | if (VALID_NAME.matcher(name).find()) |
| 45 | throw new IllegalArgumentException("ToolType.get() called with invalid name: " + name); |
| 46 | return new ToolType(name); |
| 47 | }); |
| 48 | } |
| 49 | |
| 50 | private final String name; |
| 51 |