From 189a8f019f3b6b0609960b846f8c5de34365558f Mon Sep 17 00:00:00 2001 From: Isaac Manuel Raj Date: Fri, 12 Apr 2019 16:01:51 +0530 Subject: Code Enhancement (Sonar Fixes) Sonar Issues Fixes Issue-ID: SO-1490 Change-Id: I9759c8ba1d6098e8f2b4eb6da36a676d0ecd4e19 Signed-off-by: Isaac Manuel Raj --- .../nova/api/extensions/FloatingIpsExtension.java | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'nova-client/src/main/java/com') diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java index 4b39b2e..d1ae7f4 100644 --- a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java @@ -28,13 +28,13 @@ import com.woorea.openstack.nova.model.FloatingIp; import com.woorea.openstack.nova.model.FloatingIps; public class FloatingIpsExtension { - + private final OpenStackClient CLIENT; - + public FloatingIpsExtension(OpenStackClient client) { CLIENT = client; } - + public class List extends OpenStackRequest { public List() { @@ -44,40 +44,39 @@ public class FloatingIpsExtension { } public class Allocate extends OpenStackRequest { - + public Allocate(Entity entity) { super(CLIENT, HttpMethod.POST, "/os-floating-ips", entity, FloatingIp.class); } } - + public class Deallocate extends OpenStackRequest { - + public Deallocate(String id) { super(CLIENT, HttpMethod.DELETE, new StringBuffer("/os-floating-ips/").append(id).toString(), null, Void.class); } - + } public List list() { return new List(); } - + public Allocate allocate(String pool) { Entity entity=null; if(pool!=null) { - Map body = new HashMap(); + Map body = new HashMap<>(); body.put("pool", pool); entity=Entity.json(body); } return new Allocate(entity); } - + public Deallocate deallocate(String id) { return new Deallocate(id); } - - - -} + + +} -- cgit 1.2.3-korg