summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-domain/src/main/java
diff options
context:
space:
mode:
authorParshad Patel <pars.patel@samsung.com>2019-04-23 10:37:45 +0900
committerParshad Patel <pars.patel@samsung.com>2019-07-03 15:22:24 +0900
commitaad3703c8fe9929c71f9a9465a701f56dd1cbd5a (patch)
tree0d87f08a8484ced7a5bb2a6441aa2ce76fb43171 /ecomp-sdk/epsdk-domain/src/main/java
parentb3ced8c4eb98a152076b3f0a05ba601bce7f8d2a (diff)
Fix sonar issue in epsdk-domain
Fix Constructor has 10 parameters, which is greater than 7 authorized Issue-ID: PORTAL-562 Change-Id: I8eff61e2d829c86bd20c7052c181f90eed1a5926 Signed-off-by: Parshad Patel <pars.patel@samsung.com>
Diffstat (limited to 'ecomp-sdk/epsdk-domain/src/main/java')
-rw-r--r--ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Container.java88
1 files changed, 72 insertions, 16 deletions
diff --git a/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Container.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Container.java
index 3d9ee77a..1c122491 100644
--- a/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Container.java
+++ b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Container.java
@@ -40,6 +40,7 @@ package org.onap.portalsdk.core.domain.support;
import java.util.List;
import java.util.Map;
+
public class Container {
String id;
@@ -90,22 +91,77 @@ public class Container {
}
- public Container(String id, String name, int numOfRows, int numOfCols, double interEleWd, double interEleH,
- double interEleToContainerWd, double interEleToContainerH, double interEleToInnerContainerWd,
- double interEleToInnerContainerH) {
-
- this.id = id;
- this.name = name;
- this.numOfRows = numOfRows;
- this.numOfCols = numOfCols;
- this.interEleWd = interEleWd;
- this.interEleH = interEleH;
- this.interEleToContainerWd = interEleToContainerWd;
- this.interEleToContainerH = interEleToContainerH;
- this.interEleToInnerContainerWd = interEleToInnerContainerWd;
- this.interEleToInnerContainerH = interEleToInnerContainerH;
-
- }
+ public Container(ContainerBuilder builder) {
+ this.id = builder.container.id;
+ this.name = builder.container.name;
+ this.numOfRows = builder.container.numOfRows;
+ this.numOfCols = builder.container.numOfCols;
+ this.interEleWd = builder.container.interEleWd;
+ this.interEleH = builder.container.interEleH;
+ this.interEleToContainerWd = builder.container.interEleToContainerWd;
+ this.interEleToContainerH = builder.container.interEleToContainerH;
+ this.interEleToInnerContainerWd = builder.container.interEleToInnerContainerWd;
+ this.interEleToInnerContainerH = builder.container.interEleToInnerContainerH;
+ }
+
+ public static class ContainerBuilder {
+
+ private final Container container = new Container();
+
+ public ContainerBuilder setId(String id) {
+ this.container.id = id;
+ return this;
+ }
+
+ public ContainerBuilder setName(String name) {
+ this.container.name = name;
+ return this;
+ }
+
+ public ContainerBuilder setNumOfRows(int numOfRows) {
+ this.container.numOfRows = numOfRows;
+ return this;
+ }
+
+ public ContainerBuilder setNumOfCols(int numOfCols) {
+ this.container.numOfCols = numOfCols;
+ return this;
+ }
+
+ public ContainerBuilder setInterEleWd(double interEleWd) {
+ this.container.interEleWd = interEleWd;
+ return this;
+ }
+
+ public ContainerBuilder setInterEleH(double interEleH) {
+ this.container.interEleH = interEleH;
+ return this;
+ }
+
+ public ContainerBuilder setInterEleToContainerWd(double interEleToContainerWd) {
+ this.container.interEleToContainerWd = interEleToContainerWd;
+ return this;
+ }
+
+ public ContainerBuilder setInterEleToContainerH(double interEleToContainerH) {
+ this.container.interEleToContainerH = interEleToContainerH;
+ return this;
+ }
+
+ public ContainerBuilder setInterEleToInnerContainerWd(double interEleToInnerContainerWd) {
+ this.container.interEleToInnerContainerWd = interEleToInnerContainerWd;
+ return this;
+ }
+
+ public ContainerBuilder setInterEleToInnerContainerH(double interEleToInnerContainerH) {
+ this.container.interEleToInnerContainerH = interEleToInnerContainerH;
+ return this;
+ }
+
+ public Container createContainer() {
+ return new Container(this);
+ }
+ }
public Map<String, Container> getContainerRowCol() {
return containerRowCol;