From d384da4f3f6de0d1ef3deb70f1d66a6f84cdaf9e Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Fri, 22 Feb 2019 13:57:24 +0000 Subject: remove unused code and simplify --- .../yahoo/config/model/deploy/TestProperties.java | 53 +++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) (limited to 'config-model/src/main/java/com/yahoo/config/model') diff --git a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java index f93688abddc..378c262cd72 100644 --- a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java +++ b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java @@ -73,7 +73,7 @@ public class TestProperties implements ModelContext.Properties { return this; } - public TestProperties setConfigServerSpecs(List configServerSpecs) { + public TestProperties setConfigServerSpecs(List configServerSpecs) { this.configServerSpecs = ImmutableList.copyOf(configServerSpecs); return this; } @@ -82,4 +82,55 @@ public class TestProperties implements ModelContext.Properties { this.useDedicatedNodeForLogserver = useDedicatedNodeForLogserver; return this; } + + public static class Spec implements ConfigServerSpec { + + private final String hostName; + private final int configServerPort; + private final int httpPort; + private final int zooKeeperPort; + + public String getHostName() { + return hostName; + } + + public int getConfigServerPort() { + return configServerPort; + } + + public int getHttpPort() { + return httpPort; + } + + public int getZooKeeperPort() { + return zooKeeperPort; + } + + @Override + public boolean equals(Object o) { + if (o instanceof ConfigServerSpec) { + ConfigServerSpec other = (ConfigServerSpec)o; + + return hostName.equals(other.getHostName()) && + configServerPort == other.getConfigServerPort() && + httpPort == other.getHttpPort() && + zooKeeperPort == other.getZooKeeperPort(); + } else { + return false; + } + } + + @Override + public int hashCode() { + return hostName.hashCode(); + } + + public Spec(String hostName, int configServerPort, int httpPort, int zooKeeperPort) { + this.hostName = hostName; + this.configServerPort = configServerPort; + this.httpPort = httpPort; + this.zooKeeperPort = zooKeeperPort; + } + } + } -- cgit v1.2.3