Prefer Boolean over primitive boolean in OpenStack Neutron domain classes

This commit is contained in:
Jeremy Daggett 2014-09-26 08:37:06 -07:00
parent c2c9076ad0
commit 5827b722d2
6 changed files with 34 additions and 28 deletions

View File

@ -110,7 +110,13 @@ public class ExternalGatewayInfo {
return this;
}
public Builder enableSnat(boolean enableSnat) {
/**
* Provide the enableSnat status to the ExternalGatewayInfo's Builder.
*
* @return the Builder.
* @see ExternalGatewayInfo#getEnableSnat()
*/
public Builder enableSnat(Boolean enableSnat) {
this.enableSnat = enableSnat;
return this;
}

View File

@ -182,7 +182,7 @@ public class Network {
* @return the adminStateUp of the Network
*/
@Nullable
public Boolean isAdminStateUp() {
public Boolean getAdminStateUp() {
return adminStateUp;
}
@ -193,7 +193,7 @@ public class Network {
* @return true if the network resource can be accessed by any tenant or not, false if not
*/
@Nullable
public Boolean isShared() {
public Boolean getShared() {
return shared;
}
@ -234,7 +234,7 @@ public class Network {
* @return the external of the Network
*/
@Nullable
public Boolean isExternal() {
public Boolean getExternal() {
return external;
}
@ -242,7 +242,7 @@ public class Network {
* @return the portSecurity of the Network
*/
@Nullable
public Boolean isPortSecurity() {
public Boolean getPortSecurity() {
return portSecurity;
}

View File

@ -253,7 +253,7 @@ public class Port {
* @return the administrative state of port. If false, port does not forward packets.
*/
@Nullable
public boolean isAdminStateUp() {
public Boolean getAdminStateUp() {
return adminStateUp;
}
@ -355,7 +355,7 @@ public class Port {
* @return the portSecurity of the Port
*/
@Nullable
public Boolean isPortSecurity() {
public Boolean getPortSecurity() {
return portSecurity;
}
@ -371,7 +371,7 @@ public class Port {
* @return the macLearning of the Port
*/
@Nullable
public Boolean isMacLearning() {
public Boolean getMacLearning() {
return macLearning;
}
@ -511,9 +511,9 @@ public class Port {
* Provide the adminStateUp to the Port's Builder.
*
* @return the Builder.
* @see Port#isAdminStateUp()
* @see Port#getAdminStateUp()
*/
public ParameterizedBuilderType adminStateUp(boolean adminStateUp) {
public ParameterizedBuilderType adminStateUp(Boolean adminStateUp) {
port.adminStateUp = adminStateUp;
return self();
}
@ -648,9 +648,9 @@ public class Port {
* Provide the portSecurity to the Port's Builder.
*
* @return the Builder.
* @see Port#isPortSecurity()
* @see Port#getPortSecurity()
*/
public ParameterizedBuilderType portSecurity(boolean portSecurity) {
public ParameterizedBuilderType portSecurity(Boolean portSecurity) {
port.portSecurity = portSecurity;
return self();
}
@ -670,9 +670,9 @@ public class Port {
* Provide the macLearning to the Port's Builder.
*
* @return the Builder.
* @see Port#isMacLearning()
* @see Port#getMacLearning()
*/
public ParameterizedBuilderType macLearning(boolean macLearning) {
public ParameterizedBuilderType macLearning(Boolean macLearning) {
port.macLearning = macLearning;
return self();
}

View File

@ -112,7 +112,7 @@ public class Router {
* @return the adminStateUp of the Router
*/
@Nullable
public Boolean isAdminStateUp() {
public Boolean getAdminStateUp() {
return adminStateUp;
}
@ -210,9 +210,9 @@ public class Router {
* Provide the adminStateUp to the Router's Builder.
*
* @return the Builder.
* @see Router#isAdminStateUp()
* @see Router#getAdminStateUp()
*/
public ParameterizedBuilderType adminStateUp(boolean adminStateUp) {
public ParameterizedBuilderType adminStateUp(Boolean adminStateUp) {
router.adminStateUp = adminStateUp;
return self();
}

View File

@ -59,7 +59,7 @@ public class RouterApiMockTest extends BaseNeutronApiMockTest {
NeutronApi neutronApi = api(server.getUrl("/").toString(), "openstack-neutron", overrides);
RouterApi api = neutronApi.getRouterApi("RegionOne").get();
Router.CreateRouter createRouter = Router.createBuilder().name("another_router").adminStateUp(true)
Router.CreateRouter createRouter = Router.createBuilder().name("another_router").adminStateUp(Boolean.TRUE)
.externalGatewayInfo(ExternalGatewayInfo.builder().networkId("8ca37218-28ff-41cb-9b10-039601ea7e6b").build())
.build();
@ -80,7 +80,7 @@ public class RouterApiMockTest extends BaseNeutronApiMockTest {
assertEquals(router.getName(), "another_router");
assertEquals(router.getExternalGatewayInfo().getNetworkId(), "8ca37218-28ff-41cb-9b10-039601ea7e6b");
assertEquals(router.getStatus(), NetworkStatus.ACTIVE);
assertEquals(router.isAdminStateUp().booleanValue(), true);
assertEquals(router.getAdminStateUp(), Boolean.TRUE);
assertEquals(router.getId(), "8604a0de-7f6b-409a-a47c-a1cc7bc77b2e");
assertEquals(router.getTenantId(), "6b96ff0cb17a4b859e1e575d221683d3");
} finally {
@ -100,7 +100,7 @@ public class RouterApiMockTest extends BaseNeutronApiMockTest {
NeutronApi neutronApi = api(server.getUrl("/").toString(), "openstack-neutron", overrides);
RouterApi api = neutronApi.getRouterApi("RegionOne").get();
Router.CreateRouter createRouter = Router.createBuilder().name("another_router").adminStateUp(true)
Router.CreateRouter createRouter = Router.createBuilder().name("another_router").adminStateUp(Boolean.TRUE)
.externalGatewayInfo(ExternalGatewayInfo.builder().networkId("8ca37218-28ff-41cb-9b10-039601ea7e6b").build())
.build();
@ -267,7 +267,7 @@ public class RouterApiMockTest extends BaseNeutronApiMockTest {
assertEquals(router.getName(), "router1");
assertEquals(router.getExternalGatewayInfo().getNetworkId(), "3c5bcddd-6af9-4e6b-9c3e-c153e521cab8");
assertEquals(router.getStatus(), NetworkStatus.ACTIVE);
assertEquals(router.isAdminStateUp().booleanValue(), true);
assertEquals(router.getAdminStateUp(), Boolean.TRUE);
assertEquals(router.getId(), "a9254bdb-2613-4a13-ac4c-adc581fba50d");
assertEquals(router.getTenantId(), "33a40233088643acb66ff6eb0ebea679");
} finally {
@ -338,7 +338,7 @@ public class RouterApiMockTest extends BaseNeutronApiMockTest {
assertEquals(router.getName(), "another_router");
assertEquals(router.getExternalGatewayInfo().getNetworkId(), "8ca37218-28ff-41cb-9b10-039601ea7e6b");
assertEquals(router.getStatus(), NetworkStatus.ACTIVE);
assertEquals(router.isAdminStateUp().booleanValue(), true);
assertEquals(router.getAdminStateUp(), Boolean.TRUE);
assertEquals(router.getId(), "8604a0de-7f6b-409a-a47c-a1cc7bc77b2e");
assertEquals(router.getTenantId(), "6b96ff0cb17a4b859e1e575d221683d3");
} finally {

View File

@ -63,7 +63,7 @@ public class PortApiMockTest extends BaseNeutronApiMockTest {
Port.CreatePort createPort = Port.createBuilder("6aeaf34a-c482-4bd3-9dc3-7faf36412f12")
.name("port1")
.adminStateUp(true)
.adminStateUp(Boolean.TRUE)
.deviceId("d6b4d3a5-c700-476f-b609-1493dd9dadc0")
.allowedAddressPairs(ImmutableSet.of(AddressPair.builder("12", "111.222.333.444").build()))
.build();
@ -110,7 +110,7 @@ public class PortApiMockTest extends BaseNeutronApiMockTest {
Port.CreatePort createPort = Port.createBuilder("6aeaf34a-c482-4bd3-9dc3-7faf36412f12")
.name("port1")
.adminStateUp(true)
.adminStateUp(Boolean.TRUE)
.deviceId("d6b4d3a5-c700-476f-b609-1493dd9dadc0")
.allowedAddressPairs(ImmutableSet.of(AddressPair.builder("12", "111.222.333.444").build()))
.build();
@ -248,14 +248,14 @@ public class PortApiMockTest extends BaseNeutronApiMockTest {
Port.CreatePort createPort1 = Port.createBuilder("64239a54-dcc4-4b39-920b-b37c2144effa")
.name("port1")
.adminStateUp(true)
.adminStateUp(Boolean.TRUE)
.deviceId("24df1d04-d5cb-41e1-8de5-61ed77c558df")
.securityGroups(ImmutableSet.of("dbc107f4-afcd-4d5a-9352-f68f82241d5b"))
.build();
Port.CreatePort createPort2 = Port.createBuilder("e6031bc2-901a-4c66-82da-f4c32ed89406")
.name("port2")
.adminStateUp(false)
.adminStateUp(Boolean.FALSE)
.securityGroups(
ImmutableSet.of("8bf3f7cc-8471-40b1-815f-9da47e79775b", "dbc107f4-afcd-4d5a-9352-f68f82241d5b"))
.build();
@ -293,14 +293,14 @@ public class PortApiMockTest extends BaseNeutronApiMockTest {
Port.CreatePort createPort1 = Port.createBuilder("64239a54-dcc4-4b39-920b-b37c2144effa")
.name("port1")
.adminStateUp(true)
.adminStateUp(Boolean.TRUE)
.deviceId("24df1d04-d5cb-41e1-8de5-61ed77c558df")
.securityGroups(ImmutableSet.of("dbc107f4-afcd-4d5a-9352-f68f82241d5b"))
.build();
Port.CreatePort createPort2 = Port.createBuilder("e6031bc2-901a-4c66-82da-f4c32ed89406")
.name("port2")
.adminStateUp(false)
.adminStateUp(Boolean.FALSE)
.securityGroups(
ImmutableSet.of("8bf3f7cc-8471-40b1-815f-9da47e79775b", "dbc107f4-afcd-4d5a-9352-f68f82241d5b"))
.build();