Skip to content
Permalink
Browse files
Prefer Boolean over primitive boolean in OpenStack Neutron domain cla…
…sses
  • Loading branch information
Jeremy Daggett committed Oct 1, 2014
1 parent 50218e6 commit 75572240c8504d8b369eb7fda121bf82270c3566
Showing 6 changed files with 34 additions and 28 deletions.
@@ -110,7 +110,13 @@ public Builder networkId(String networkId) {
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;
}
@@ -182,7 +182,7 @@ public String getName() {
* @return the adminStateUp of the Network
*/
@Nullable
public Boolean isAdminStateUp() {
public Boolean getAdminStateUp() {
return adminStateUp;
}

@@ -193,7 +193,7 @@ public Boolean isAdminStateUp() {
* @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,15 +234,15 @@ public Integer getSegmentationId() {
* @return the external of the Network
*/
@Nullable
public Boolean isExternal() {
public Boolean getExternal() {
return external;
}

/**
* @return the portSecurity of the Network
*/
@Nullable
public Boolean isPortSecurity() {
public Boolean getPortSecurity() {
return portSecurity;
}

@@ -253,7 +253,7 @@ public String getNetworkId() {
* @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 ImmutableMap<String, Object> getProfile() {
* @return the portSecurity of the Port
*/
@Nullable
public Boolean isPortSecurity() {
public Boolean getPortSecurity() {
return portSecurity;
}

@@ -371,7 +371,7 @@ public String getProfileId() {
* @return the macLearning of the Port
*/
@Nullable
public Boolean isMacLearning() {
public Boolean getMacLearning() {
return macLearning;
}

@@ -511,9 +511,9 @@ public ParameterizedBuilderType networkId(String networkId) {
* 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 ParameterizedBuilderType profile(ImmutableMap<String, Object> profile) {
* 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 ParameterizedBuilderType profileId(String profileId) {
* 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();
}
@@ -112,7 +112,7 @@ public String getTenantId() {
* @return the adminStateUp of the Router
*/
@Nullable
public Boolean isAdminStateUp() {
public Boolean getAdminStateUp() {
return adminStateUp;
}

@@ -210,9 +210,9 @@ public ParameterizedBuilderType tenantId(String tenantId) {
* 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();
}
@@ -59,7 +59,7 @@ public void testCreateRouter() throws IOException, InterruptedException, URISynt
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 void testCreateRouter() throws IOException, InterruptedException, URISynt
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 void testCreateRouterFail() throws IOException, InterruptedException, URI
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 void testGetRouter() throws IOException, InterruptedException, URISyntaxE
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 void testUpdateRouter() throws IOException, InterruptedException, URISynt
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 {
@@ -63,7 +63,7 @@ public void testCreatePort() throws IOException, InterruptedException, URISyntax

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 void testCreatePortFail() throws IOException, InterruptedException, URISy

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 void testCreateBulkPort() throws IOException, InterruptedException, URISy

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 void testCreateBulkPortFail() throws IOException, InterruptedException, U

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();

0 comments on commit 7557224

Please sign in to comment.