// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.entity;

import java.util.Objects;
import java.util.Optional;

/**
 * Information about a node from a {@link EntityService}.
 *
 * @author mpolden
 */
public class NodeEntity {

    private final String hostname;
    private final Optional<String> model;
    private final Optional<String> manufacturer;

    public NodeEntity(String hostname, String model, String manufacturer) {
        this.hostname = Objects.requireNonNull(hostname);
        this.model = nonBlank(model);
        this.manufacturer = nonBlank(manufacturer);
    }

    public String hostname() {
        return hostname;
    }

    /** The model name of this node */
    public Optional<String> model() {
        return model;
    }

    /** The manufacturer of this node */
    public Optional<String> manufacturer() {
        return manufacturer;
    }

    private static Optional<String> nonBlank(String s) {
        return Optional.ofNullable(s).filter(v -> !v.isBlank());
    }

}

@@ -467,16 +467,67 @@
 acturer;
+%0A    private final Optional%3CString%3E switchHostname;
 %0A%0A    pu
@@ -592,16 +592,39 @@
 facturer
+, String switchHostname
 ) %7B%0A    
@@ -767,16 +767,72 @@
 turer);%0A
+        this.switchHostname = nonBlank(switchHostname);%0A
     %7D%0A%0A 
@@ -1117,24 +1117,177 @@
 rer;%0A    %7D%0A%0A
+    /** The hostname of network switch this node is connected to */%0A    public Optional%3CString%3E switchHostname() %7B%0A        return switchHostname;%0A    %7D%0A%0A
     private 

Add switch hostname to node entity