From e2bb43a3920d61f299ac686f8ff90908bf83b505 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Wed, 10 Apr 2019 13:08:00 +0530 Subject: [PATCH] refactoring Signed-off-by: Abhishek Kumar --- .../admin/offering/CreateDiskOfferingCmd.java | 6 ++--- .../offering/CreateServiceOfferingCmd.java | 22 +++++++++---------- .../admin/offering/UpdateDiskOfferingCmd.java | 14 ++++++------ .../offering/UpdateServiceOfferingCmd.java | 12 +++++----- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java index 41d71c821c6..3ff8f69568c 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java @@ -181,7 +181,7 @@ public class CreateDiskOfferingCmd extends BaseCmd { } public List getDomainIds() { - if(CollectionUtils.isNotEmpty(domainIds)) { + if (CollectionUtils.isNotEmpty(domainIds)) { Set set = new LinkedHashSet<>(domainIds); domainIds.clear(); domainIds.addAll(set); @@ -190,7 +190,7 @@ public class CreateDiskOfferingCmd extends BaseCmd { } public List getZoneIds() { - if(CollectionUtils.isNotEmpty(zoneIds)) { + if (CollectionUtils.isNotEmpty(zoneIds)) { Set set = new LinkedHashSet<>(zoneIds); zoneIds.clear(); zoneIds.addAll(set); @@ -250,7 +250,7 @@ public class CreateDiskOfferingCmd extends BaseCmd { return storageType; } - public String getProvisioningType(){ + public String getProvisioningType() { return provisioningType; } diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java index 347e3308b26..c30b43745c5 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java @@ -77,8 +77,8 @@ public class CreateServiceOfferingCmd extends BaseCmd { private Boolean limitCpuUse; @Parameter(name = ApiConstants.IS_VOLATILE, - type = CommandType.BOOLEAN, - description = "true if the virtual machine needs to be volatile so that on every reboot of VM, original root disk is dettached then destroyed and a fresh root disk is created and attached to VM") + type = CommandType.BOOLEAN, + description = "true if the virtual machine needs to be volatile so that on every reboot of VM, original root disk is dettached then destroyed and a fresh root disk is created and attached to VM") private Boolean isVolatile; @Parameter(name = ApiConstants.STORAGE_TYPE, type = CommandType.STRING, description = "the storage type of the service offering. Values are local and shared.") @@ -109,18 +109,18 @@ public class CreateServiceOfferingCmd extends BaseCmd { private Boolean isSystem; @Parameter(name = ApiConstants.SYSTEM_VM_TYPE, - type = CommandType.STRING, - description = "the system VM type. Possible types are \"domainrouter\", \"consoleproxy\" and \"secondarystoragevm\".") + type = CommandType.STRING, + description = "the system VM type. Possible types are \"domainrouter\", \"consoleproxy\" and \"secondarystoragevm\".") private String systemVmType; @Parameter(name = ApiConstants.NETWORKRATE, - type = CommandType.INTEGER, - description = "data transfer rate in megabits per second allowed. Supported only for non-System offering and system offerings having \"domainrouter\" systemvmtype") + type = CommandType.INTEGER, + description = "data transfer rate in megabits per second allowed. Supported only for non-System offering and system offerings having \"domainrouter\" systemvmtype") private Integer networkRate; @Parameter(name = ApiConstants.DEPLOYMENT_PLANNER, - type = CommandType.STRING, - description = "The deployment planner heuristics used to deploy a VM of this offering. If null, value of global config vm.deployment.planner is used") + type = CommandType.STRING, + description = "The deployment planner heuristics used to deploy a VM of this offering. If null, value of global config vm.deployment.planner is used") private String deploymentPlanner; @Parameter(name = ApiConstants.SERVICE_OFFERING_DETAILS, type = CommandType.MAP, description = "details for planner, used to store specific parameters") @@ -228,7 +228,7 @@ public class CreateServiceOfferingCmd extends BaseCmd { return displayText; } - public String getProvisioningType(){ + public String getProvisioningType() { return provisioningType; } @@ -264,7 +264,7 @@ public class CreateServiceOfferingCmd extends BaseCmd { } public List getDomainIds() { - if(CollectionUtils.isNotEmpty(domainIds)) { + if (CollectionUtils.isNotEmpty(domainIds)) { Set set = new LinkedHashSet<>(domainIds); domainIds.clear(); domainIds.addAll(set); @@ -273,7 +273,7 @@ public class CreateServiceOfferingCmd extends BaseCmd { } public List getZoneIds() { - if(CollectionUtils.isNotEmpty(zoneIds)) { + if (CollectionUtils.isNotEmpty(zoneIds)) { Set set = new LinkedHashSet<>(zoneIds); zoneIds.clear(); zoneIds.addAll(set); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java index b179c26bd3a..8e8ff2b4385 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java @@ -46,9 +46,9 @@ public class UpdateDiskOfferingCmd extends BaseCmd { ///////////////////////////////////////////////////// @Parameter(name = ApiConstants.DISPLAY_TEXT, - type = CommandType.STRING, - description = "updates alternate display text of the disk offering with this value", - length = 4096) + type = CommandType.STRING, + description = "updates alternate display text of the disk offering with this value", + length = 4096) private String displayText; @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = DiskOfferingResponse.class, required = true, description = "ID of the disk offering") @@ -61,8 +61,8 @@ public class UpdateDiskOfferingCmd extends BaseCmd { private Integer sortKey; @Parameter(name = ApiConstants.DISPLAY_OFFERING, - type = CommandType.BOOLEAN, - description = "an optional field, whether to display the offering to the end user or not.") + type = CommandType.BOOLEAN, + description = "an optional field, whether to display the offering to the end user or not.") private Boolean displayOffering; @Parameter(name = ApiConstants.DOMAIN_ID, @@ -105,7 +105,7 @@ public class UpdateDiskOfferingCmd extends BaseCmd { } public List getDomainIds() { - if(CollectionUtils.isNotEmpty(domainIds)) { + if (CollectionUtils.isNotEmpty(domainIds)) { Set set = new LinkedHashSet<>(domainIds); domainIds.clear(); domainIds.addAll(set); @@ -114,7 +114,7 @@ public class UpdateDiskOfferingCmd extends BaseCmd { } public List getZoneIds() { - if(CollectionUtils.isNotEmpty(zoneIds)) { + if (CollectionUtils.isNotEmpty(zoneIds)) { Set set = new LinkedHashSet<>(zoneIds); zoneIds.clear(); zoneIds.addAll(set); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/UpdateServiceOfferingCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/UpdateServiceOfferingCmd.java index 4d70edad8be..c2e11e5fe45 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/UpdateServiceOfferingCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/UpdateServiceOfferingCmd.java @@ -45,10 +45,10 @@ public class UpdateServiceOfferingCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// @Parameter(name = ApiConstants.ID, - type = CommandType.UUID, - entityType = ServiceOfferingResponse.class, - required = true, - description = "the ID of the service offering to be updated") + type = CommandType.UUID, + entityType = ServiceOfferingResponse.class, + required = true, + description = "the ID of the service offering to be updated") private Long id; @Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, description = "the display text of the service offering to be updated") @@ -96,7 +96,7 @@ public class UpdateServiceOfferingCmd extends BaseCmd { } public List getDomainIds() { - if(CollectionUtils.isNotEmpty(domainIds)) { + if (CollectionUtils.isNotEmpty(domainIds)) { Set set = new LinkedHashSet<>(domainIds); domainIds.clear(); domainIds.addAll(set); @@ -105,7 +105,7 @@ public class UpdateServiceOfferingCmd extends BaseCmd { } public List getZoneIds() { - if(CollectionUtils.isNotEmpty(zoneIds)) { + if (CollectionUtils.isNotEmpty(zoneIds)) { Set set = new LinkedHashSet<>(zoneIds); zoneIds.clear(); zoneIds.addAll(set);