Skip to content
Permalink
Browse files
Use State enum instead of String state in Domain classes
  • Loading branch information
Boris Trishkin authored and nacx committed Jan 14, 2019
1 parent 13b18bc commit 6dec3774ab82616bac5deb977d9003eea8845632
Showing 5 changed files with 13 additions and 13 deletions.
@@ -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 static class Builder {

public abstract Builder organization(AccountOrganization organization);

public abstract Builder state(String state);
public abstract Builder state(State state);

abstract Account autoBuild();

@@ -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 static class Builder {

public abstract Builder speed(String speed);

public abstract Builder state(String state);
public abstract Builder state(State state);

public abstract Disk build();
}
@@ -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 static class Builder {

public abstract Builder vlanName(String vlanName);

public abstract Builder state(String state);
public abstract Builder state(State state);

public abstract NIC build();
}
@@ -56,10 +56,10 @@ public Server expected() {
.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();
@@ -59,11 +59,11 @@ public Servers expected() {
.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());

0 comments on commit 6dec377

Please sign in to comment.