public ServerImpl(Server server) { this.url = server.getUrl(); this.status = server.getStatus(); if (server.getAttributes() != null) { this.attributes = new HashMap<>(server.getAttributes()); } else { this.attributes = new HashMap<>(); } }
public ServerImpl(String name, Server server) { this.name = name; this.url = nullToEmpty(server.getUrl()); // some servers doesn't have URL this.status = server.getStatus(); if (server.getAttributes() != null) { this.attributes = new HashMap<>(server.getAttributes()); } else { this.attributes = new HashMap<>(); } }
Server server = serverEntry.getValue(); String serverUrl = server.getUrl(); Map<String, String> attributes = server.getAttributes();
String name = entry.getKey(); Server incomingServer = entry.getValue(); if (Boolean.parseBoolean(incomingServer.getAttributes().get(INTERNAL_SERVER_ATTRIBUTE))) { outgoing.put(name, incomingServer); } else {
/** Converts {@link Server} to {@link ServerDto}. */ public static ServerDto asDto(Server server) { return newDto(ServerDto.class) .withUrl(server.getUrl()) .withStatus(server.getStatus()) .withAttributes(server.getAttributes()); }