diff options
author | Arindam Mondal <arind.mondal@samsung.com> | 2019-04-18 19:05:58 +0900 |
---|---|---|
committer | arind.mondal <arind.mondal@samsung.com> | 2019-04-18 20:15:29 +0900 |
commit | b3ced8c4eb98a152076b3f0a05ba601bce7f8d2a (patch) | |
tree | b291f70c47c93cca6584665ee97161fb9452717d /ecomp-sdk/epsdk-domain/src/main/java/org/onap | |
parent | 383968fe6e903bc81c127e797b7c32cf99e0e246 (diff) |
Fix sonar issue: implement builder
Sonar link: https://sonar.onap.org/issues?projectUuids=AV8LJxI3uDqGnRl2bdaB&resolved=false&rules=squid%3AS00107
Issue-ID: PORTAL-559
Change-Id: I28c202e69f4856131b91918c41343ae6a5df3bbe
Signed-off-by: arind.mondal <arind.mondal@samsung.com>
Diffstat (limited to 'ecomp-sdk/epsdk-domain/src/main/java/org/onap')
-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; } |