diff options
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.java | 88 |
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; |