jclouds-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject [jclouds-labs] branch 2.1.x updated: Use State enum instead of String state in Domain classes
Date Mon, 14 Jan 2019 09:22:52 GMT
This is an automated email from the ASF dual-hosted git repository.

nacx pushed a commit to branch 2.1.x
in repository https://gitbox.apache.org/repos/asf/jclouds-labs.git


The following commit(s) were added to refs/heads/2.1.x by this push:
     new f909157  Use State enum instead of String state in Domain classes
f909157 is described below

commit f909157f3b679c500005d4590cc665ff2c364732
Author: Boris Trishkin <boris.trishkin@itaas.dimensiondata.com>
AuthorDate: Fri Jan 11 12:42:29 2019 +0000

    Use State enum instead of String state in Domain classes
---
 .../java/org/jclouds/dimensiondata/cloudcontrol/domain/Account.java | 6 +++---
 .../java/org/jclouds/dimensiondata/cloudcontrol/domain/Disk.java    | 6 +++---
 .../java/org/jclouds/dimensiondata/cloudcontrol/domain/NIC.java     | 6 +++---
 .../jclouds/dimensiondata/cloudcontrol/parse/ServerParseTest.java   | 4 ++--
 .../jclouds/dimensiondata/cloudcontrol/parse/ServersParseTest.java  | 4 ++--
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Account.java
b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Account.java
index 0f257ef..9e6da85 100644
--- a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Account.java
+++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Account.java
@@ -54,7 +54,7 @@ public abstract class Account {
    public abstract AccountOrganization organization();
 
    @Nullable
-   public abstract String state();
+   public abstract State state();
 
    Account() {
    }
@@ -63,7 +63,7 @@ public abstract class Account {
          "customDefined1", "customDefined2", "organization", "state" })
    public static Account create(String userName, String fullName, String firstName, String
lastName,
          String emailAddress, List<RoleType> roles, AccountPhoneNumber phone, String
department, String customDefined1,
-         String customDefined2, AccountOrganization organization, String state) {
+         String customDefined2, AccountOrganization organization, State state) {
       return builder().userName(userName).fullName(fullName).firstName(firstName).lastName(lastName)
             .emailAddress(emailAddress).roles(roles).phone(phone).department(department).customDefined1(customDefined1)
             .customDefined2(customDefined2).organization(organization).state(state).build();
@@ -99,7 +99,7 @@ public abstract class Account {
 
       public abstract Builder organization(AccountOrganization organization);
 
-      public abstract Builder state(String state);
+      public abstract Builder state(State state);
 
       abstract Account autoBuild();
 
diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Disk.java
b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Disk.java
index 575b39c..94d4398 100644
--- a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Disk.java
+++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Disk.java
@@ -38,10 +38,10 @@ public abstract class Disk {
    public abstract String speed();
 
    @Nullable
-   public abstract String state();
+   public abstract State state();
 
    @SerializedNames({ "id", "scsiId", "sizeGb", "speed", "state" })
-   public static Disk create(String id, Integer scsiId, Integer sizeGb, String speed, String
state) {
+   public static Disk create(String id, Integer scsiId, Integer sizeGb, String speed, State
state) {
       return builder().id(id).scsiId(scsiId).sizeGb(sizeGb).speed(speed).state(state).build();
    }
 
@@ -57,7 +57,7 @@ public abstract class Disk {
 
       public abstract Builder speed(String speed);
 
-      public abstract Builder state(String state);
+      public abstract Builder state(State state);
 
       public abstract Disk build();
    }
diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NIC.java
b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NIC.java
index 33f468f..4d0dc16 100644
--- a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NIC.java
+++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NIC.java
@@ -41,10 +41,10 @@ public abstract class NIC {
    public abstract String vlanName();
 
    @Nullable
-   public abstract String state();
+   public abstract State state();
 
    @SerializedNames({ "id", "privateIpv4", "ipv6", "vlanId", "vlanName", "state" })
-   public static NIC create(String id, String privateIpv4, String ipv6, String vlanId, String
vlanName, String state) {
+   public static NIC create(String id, String privateIpv4, String ipv6, String vlanId, String
vlanName, State state) {
       return builder().id(id).privateIpv4(privateIpv4).ipv6(ipv6).vlanId(vlanId).vlanName(vlanName).state(state)
             .build();
    }
@@ -63,7 +63,7 @@ public abstract class NIC {
 
       public abstract Builder vlanName(String vlanName);
 
-      public abstract Builder state(String state);
+      public abstract Builder state(State state);
 
       public abstract NIC build();
    }
diff --git a/dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/parse/ServerParseTest.java
b/dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/parse/ServerParseTest.java
index 5d44d5e..41486df 100644
--- a/dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/parse/ServerParseTest.java
+++ b/dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/parse/ServerParseTest.java
@@ -56,10 +56,10 @@ public class ServerParseTest extends BaseDimensionDataCloudControlParseTest<Serv
             .cpu(CPU.builder().count(2).speed("STANDARD").coresPerSocket(1).build()).memoryGb(4).disks(Collections
                   .singletonList(
                         Disk.builder().id("918f12ba-5e5e-4cd6-87bd-60c18293c24d").scsiId(0).sizeGb(20).speed("STANDARD")
-                              .state("NORMAL").build())).networkInfo(NetworkInfo.builder().primaryNic(
+                              .state(State.NORMAL).build())).networkInfo(NetworkInfo.builder().primaryNic(
                   NIC.builder().id("f0c00cab-bfa3-4c51-8c0a-c52fdac1ae4b").privateIpv4("10.0.0.7")
                         .ipv6("2a00:47c0:111:1131:5851:1950:411c:3dd8").vlanId("7bd12a4d-4e83-4254-a266-174aa5f55187")
-                        .vlanName("jclouds vlan").state("NORMAL").build()).additionalNic(Collections.<NIC>emptyList())
+                        .vlanName("jclouds vlan").state(State.NORMAL).build()).additionalNic(Collections.<NIC>emptyList())
                   .networkDomainId("d122949b-8990-46d6-98f0-91c8676fc720").build())
             .virtualHardware(VirtualHardware.builder().upToDate(true).version("vmx-10").build())
             .softwareLabels(Collections.emptyList()).build();
diff --git a/dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/parse/ServersParseTest.java
b/dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/parse/ServersParseTest.java
index eb97dae..d67c64a 100644
--- a/dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/parse/ServersParseTest.java
+++ b/dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/parse/ServersParseTest.java
@@ -59,11 +59,11 @@ public class ServersParseTest extends BaseDimensionDataCloudControlParseTest<Ser
                               .runningStatus(VmTools.RunningStatus.RUNNING).build()).osCustomization(true).build())
                   .cpu(CPU.builder().count(2).speed("STANDARD").coresPerSocket(1).build()).memoryGb(4).disks(Collections
                         .singletonList(Disk.builder().id("0ba67812-d7b7-4c3f-b114-870fbea24d42").scsiId(0).sizeGb(10)
-                              .speed("STANDARD").state("NORMAL").build())).networkInfo(NetworkInfo.builder().primaryNic(
+                              .speed("STANDARD").state(State.NORMAL).build())).networkInfo(NetworkInfo.builder().primaryNic(
                         NIC.builder().id("980a9fdd-4ea2-478b-85b4-f016349f1738").privateIpv4("10.0.0.8")
                               .ipv6("2607:f480:111:1575:c47:7479:2af8:3f1a")
                               .vlanId("6b25b02e-d3a2-4e69-8ca7-9bab605deebd")
-                              .vlanId("6b25b02e-d3a2-4e69-8ca7-9bab605deebd").vlanName("vlan1").state("NORMAL").build())
+                              .vlanId("6b25b02e-d3a2-4e69-8ca7-9bab605deebd").vlanName("vlan1").state(State.NORMAL).build())
                         .additionalNic(null).networkDomainId("690de302-bb80-49c6-b401-8c02bbefb945").build())
                   .virtualHardware(VirtualHardware.builder().upToDate(false).version("vmx-08").build())
                   .softwareLabels(Collections.emptyList()).build());


Mime
View raw message