public static NodeType typeFrom(String nodeType) {
        return switch (nodeType) {
            case "tenant" -> NodeType.tenant;
            case "host" -> NodeType.host;
            case "proxy" -> NodeType.proxy;
            case "proxyhost" -> NodeType.proxyhost;
            case "config" -> NodeType.config;
            case "confighost" -> NodeType.confighost;
            case "controller" -> NodeType.controller;
            case "controllerhost" -> NodeType.controllerhost;
            default -> throw new IllegalArgumentException("Unknown node type '" + nodeType + "'");
        };
    }
Serializer for node wire format. Used to serialize node objects sent over the wire (HTTP).

@author mpolden
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/NodeSerializer.java