From f3bbcb601d4fbf4e82dce31e8eb08886242bb585 Mon Sep 17 00:00:00 2001 From: Adam Lowe Date: Mon, 16 Jan 2012 20:04:13 +0000 Subject: [PATCH] Renaming ServerIp to Ip --- .../glesys/domain/{ServerIp.java => Ip.java} | 14 +++++++------- .../org/jclouds/glesys/domain/ServerCreated.java | 14 +++++++------- .../org/jclouds/glesys/domain/ServerDetails.java | 14 +++++++------- .../glesys/features/ServerClientExpectTest.java | 10 +++++----- .../glesys/parse/ParseServerCreatedTest.java | 4 ++-- .../glesys/parse/ParseServerDetailsTest.java | 4 ++-- 6 files changed, 30 insertions(+), 30 deletions(-) rename sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/{ServerIp.java => Ip.java} (90%) diff --git a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerIp.java b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/Ip.java similarity index 90% rename from sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerIp.java rename to sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/Ip.java index e85887fe12..fef18f4c5a 100644 --- a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerIp.java +++ b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/Ip.java @@ -28,7 +28,7 @@ import com.google.common.base.Objects; * @see ServerCreated * @see ServerDetails */ -public class ServerIp { +public class Ip { public static Builder builder() { return new Builder(); @@ -62,11 +62,11 @@ public class ServerIp { return this; } - public ServerIp build() { - return new ServerIp(ip, version, cost); + public Ip build() { + return new Ip(ip, version, cost); } - public Builder fromIpCreated(ServerIp from) { + public Builder fromIpCreated(Ip from) { return ip(from.getIp()).version(from.getVersion()).cost(from.getCost()); } } @@ -75,7 +75,7 @@ public class ServerIp { protected final int version; protected final double cost; - public ServerIp(String ip, int version, double cost) { + public Ip(String ip, int version, double cost) { this.ip = ip; this.version = version; this.cost = cost; @@ -107,8 +107,8 @@ public class ServerIp { if (this == object) { return true; } - if (object instanceof ServerIp) { - final ServerIp other = (ServerIp) object; + if (object instanceof Ip) { + final Ip other = (Ip) object; return Objects.equal(ip, other.ip) && Objects.equal(version, other.version) && Objects.equal(cost, other.cost); diff --git a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerCreated.java b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerCreated.java index d2f42d75ee..bf0b17b1d9 100644 --- a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerCreated.java +++ b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerCreated.java @@ -43,19 +43,19 @@ public class ServerCreated { public static class Builder { private String id; private String hostname; - private List ips; + private List ips; public Builder id(String id) { this.id = id; return this; } - public Builder ips(List ips) { + public Builder ips(List ips) { this.ips = ips; return this; } - public Builder ips(ServerIp... ips) { + public Builder ips(Ip... ips) { return ips(Arrays.asList(ips)); } @@ -77,9 +77,9 @@ public class ServerCreated { private final String id; private final String hostname; @SerializedName("iplist") - private final List ips; + private final List ips; - public ServerCreated(String id, @Nullable String hostname, List ips) { + public ServerCreated(String id, @Nullable String hostname, List ips) { checkNotNull(id, "id"); this.id = id; this.hostname = hostname; @@ -100,8 +100,8 @@ public class ServerCreated { } /** @return the IP addresses assigned to the server */ - public List getIps() { - return ips == null ? ImmutableList.of() : ips; + public List getIps() { + return ips == null ? ImmutableList.of() : ips; } @Override diff --git a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerDetails.java b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerDetails.java index 8b507b9a42..b597a11b4e 100644 --- a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerDetails.java +++ b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerDetails.java @@ -46,7 +46,7 @@ public class ServerDetails extends Server { private int disk; private int transfer; private Cost cost; - private List ips; + private List ips; public Builder description(String description) { this.description = description; @@ -83,11 +83,11 @@ public class ServerDetails extends Server { return this; } - public Builder ips(ServerIp... ips) { + public Builder ips(Ip... ips) { return ips(Arrays.asList(ips)); } - public Builder ips(List ips) { + public Builder ips(List ips) { this.ips = ips; return this; } @@ -136,10 +136,10 @@ public class ServerDetails extends Server { private final int transfer; private final Cost cost; @SerializedName("iplist") - private final List ips; + private final List ips; public ServerDetails(String id, String hostname, String datacenter, String platform, String template, - String description, int cpuCores, int memory, int disk, int transfer, Cost cost, List ips) { + String description, int cpuCores, int memory, int disk, int transfer, Cost cost, List ips) { super(id, hostname, datacenter, platform); this.template = checkNotNull(template, "template"); this.description = description; @@ -148,7 +148,7 @@ public class ServerDetails extends Server { this.disk = disk; this.transfer = transfer; this.cost = checkNotNull(cost, "cost"); - this.ips = ips == null ? ImmutableList.of() : ips; + this.ips = ips == null ? ImmutableList.of() : ips; } /** @@ -196,7 +196,7 @@ public class ServerDetails extends Server { /** * @return the ip addresses assigned to the server */ - public List getIps() { + public List getIps() { return ips; } diff --git a/sandbox-providers/glesys/src/test/java/org/jclouds/glesys/features/ServerClientExpectTest.java b/sandbox-providers/glesys/src/test/java/org/jclouds/glesys/features/ServerClientExpectTest.java index 8d1e7ac91f..1b4b78c640 100644 --- a/sandbox-providers/glesys/src/test/java/org/jclouds/glesys/features/ServerClientExpectTest.java +++ b/sandbox-providers/glesys/src/test/java/org/jclouds/glesys/features/ServerClientExpectTest.java @@ -24,7 +24,7 @@ import org.jclouds.glesys.GleSYSClient; import org.jclouds.glesys.domain.Server; import org.jclouds.glesys.domain.ServerCreated; import org.jclouds.glesys.domain.ServerDetails; -import org.jclouds.glesys.domain.ServerIp; +import org.jclouds.glesys.domain.Ip; import org.jclouds.glesys.options.*; import org.jclouds.glesys.parse.*; import org.jclouds.http.HttpRequest; @@ -128,7 +128,7 @@ public class ServerClientExpectTest extends BaseRestClientExpectTest { @SelectJson("server") @Consumes(MediaType.APPLICATION_JSON) public ServerCreated expected() { - return ServerCreated.builder().id("xm3630641").hostname("jclouds-test-host").ips(ServerIp.builder().ip("109.74.10.27").version4().cost(2.00).build()).build(); + return ServerCreated.builder().id("xm3630641").hostname("jclouds-test-host").ips(Ip.builder().ip("109.74.10.27").version4().cost(2.00).build()).build(); } diff --git a/sandbox-providers/glesys/src/test/java/org/jclouds/glesys/parse/ParseServerDetailsTest.java b/sandbox-providers/glesys/src/test/java/org/jclouds/glesys/parse/ParseServerDetailsTest.java index 0acbdb6320..408a954070 100644 --- a/sandbox-providers/glesys/src/test/java/org/jclouds/glesys/parse/ParseServerDetailsTest.java +++ b/sandbox-providers/glesys/src/test/java/org/jclouds/glesys/parse/ParseServerDetailsTest.java @@ -24,7 +24,7 @@ import com.google.inject.Injector; import org.jclouds.glesys.config.GleSYSParserModule; import org.jclouds.glesys.domain.Cost; import org.jclouds.glesys.domain.ServerDetails; -import org.jclouds.glesys.domain.ServerIp; +import org.jclouds.glesys.domain.Ip; import org.jclouds.json.BaseItemParserTest; import org.jclouds.json.config.GsonModule; import org.jclouds.rest.annotations.SelectJson; @@ -48,7 +48,7 @@ public class ParseServerDetailsTest extends BaseItemParserTest { @SelectJson("server") @Consumes(MediaType.APPLICATION_JSON) public ServerDetails expected() { - ServerIp ip = ServerIp.builder().version4().ip("31.192.226.45").cost(2.0).build(); + Ip ip = Ip.builder().version4().ip("31.192.226.45").cost(2.0).build(); Cost cost = Cost.builder().amount(6.38).currency("EUR").timePeriod("month").build(); return ServerDetails.builder().id("vz1375882").transfer(50).hostname("jclouds-unit").cpuCores(1).memory(128).disk(5) .description("unit test server").datacenter("Falkenberg").platform("OpenVZ").template("Debian 6.0 64-bit")