diff options
Diffstat (limited to 'ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk')
-rw-r--r-- | ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Domain.java | 88 |
1 files changed, 74 insertions, 14 deletions
diff --git a/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Domain.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Domain.java index dcf4fd54..8dd51757 100644 --- a/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Domain.java +++ b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Domain.java @@ -65,20 +65,80 @@ public class Domain { double newXafterColl; double YafterColl; - public Domain(String id, String name, double interContWd, double interContH, double domainToLayoutWd, - double domainToLayoutH, double domainToContH, int numOfRowsofContainer, int numOfColsofContainer) { - this.id = id; - this.name = name; - this.interContWd = interContWd; - this.interContH = interContH; - this.domainToLayoutWd = domainToLayoutWd; - this.domainToLayoutH = domainToLayoutH; - this.domainToContH = domainToContH; - this.numOfRowsofContainer = numOfRowsofContainer; - this.numOfColsofContainer = numOfColsofContainer; - } - - public Position getP() { + public static class DomainBuilder { + private String id; + private String name; + private double interContWd; + private double interContH; + private double domainToLayoutWd; + private double domainToLayoutH; + private double domainToContH; + private int numOfRowsofContainer; + private int numOfColsofContainer; + + public DomainBuilder setId(String id) { + this.id = id; + return this; + } + + public DomainBuilder setName(String name) { + this.name = name; + return this; + } + + public DomainBuilder setInterContWd(double interContWd) { + this.interContWd = interContWd; + return this; + } + + public DomainBuilder setInterContH(double interContH) { + this.interContH = interContH; + return this; + } + + public DomainBuilder setDomainToLayoutWd(double domainToLayoutWd) { + this.domainToLayoutWd = domainToLayoutWd; + return this; + } + + public DomainBuilder setDomainToLayoutH(double domainToLayoutH) { + this.domainToLayoutH = domainToLayoutH; + return this; + } + + public DomainBuilder setDomainToContH(double domainToContH) { + this.domainToContH = domainToContH; + return this; + } + + public DomainBuilder setNumOfRowsofContainer(int numOfRowsofContainer) { + this.numOfRowsofContainer = numOfRowsofContainer; + return this; + } + + public DomainBuilder setNumOfColsofContainer(int numOfColsofContainer) { + this.numOfColsofContainer = numOfColsofContainer; + return this; + } + + public Domain createDomain() { + return new Domain(this); + } + } + + public Domain(DomainBuilder domainBuilder) { + this.id = domainBuilder.id; + this.name = domainBuilder.name; + this.interContWd = domainBuilder.interContWd; + this.interContH = domainBuilder.interContH; + this.domainToLayoutWd = domainBuilder.domainToLayoutWd; + this.domainToLayoutH = domainBuilder.domainToLayoutH; + this.domainToContH = domainBuilder.domainToContH; + this.numOfRowsofContainer = domainBuilder.numOfRowsofContainer; + this.numOfColsofContainer = domainBuilder.numOfColsofContainer; + } + + public Position getP() { return p; } |