@Override public NodePropertiesRequest deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException { JsonObject jsonObj = json.getAsJsonObject(); String clusterId = context.deserialize(jsonObj.get("clusterId"), String.class); Set<String> properties = context.deserialize(jsonObj.get("properties"), new TypeToken<Set<String>>() { }.getType()); Set<String> services = context.deserialize(jsonObj.get("services"), new TypeToken<Set<String>>() { }.getType()); return new NodePropertiesRequest(clusterId, properties, services); } }
Set<Node> clusterNodes = clusterStoreService.getView(account).getClusterNodes(nodeRequest.getClusterId()); Set<String> properties = nodeRequest.getProperties(); Set<String> requiredServices = nodeRequest.getServices();