From 2478851790e39c44a6a851ea8b8256d4c870f692 Mon Sep 17 00:00:00 2001 From: varunVNnayar Date: Wed, 10 Dec 2014 16:46:58 +0530 Subject: [PATCH] Upate Office Helper! --- .../common/office/OfficeHelper | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/office/OfficeHelper b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/office/OfficeHelper index 84a470474..1e7707a6c 100644 --- a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/office/OfficeHelper +++ b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/office/OfficeHelper @@ -8,6 +8,11 @@ public class OfficeHelper { private String name; private String externalId; + private Long id; + private String nameDecorated; + private int openingDate[] = new int[3]; + private String hierarchy; + private Builder(final String name) { this.name = name; @@ -18,6 +23,86 @@ public class OfficeHelper { return this; } + public Builder id(final long id) { + this.id = id; + } + + public Builder nameDecorated(final String nameDecorated) { + this.nameDecorated = nameDecorated; + } + + public Builder openingDate(final int[] openingDate) { + this.openingDate = openingDate; + } + + public Builder hierarchy(final String hierarchy) { + this.hierarchy = hierarchy; + } + public OfficeHelper build() { + return new OfficeHelper(this.name, this.externalId, this.id, this.nameDecorated, this.openingDate, this.hierarchy); + } } + + + + private String name; + private String externalId; + private Long id; + private String nameDecorated; + + + OfficeHelper() { + super(); + } + + private OfficeHelper(final String name, + final String externalId, final String nameDecorated, final String hierarchy, final int[] openingDate, final Long id) { + super(); + this.name = name; + this.externalId = externalId; + this.nameDecorated = nameDecorated; + this.hierarchy = hierarchy; + this.openingDate = openingDate; + this.id = id; + } + + + } + + public String toJSON() { + return new Gson().toJson(this); + } + + public static OfficeHelper fromJSON(final String jsonData) { + return new Gson().fromJson(jsonData, OfficeHelper.class); + } + + public String getName() { + return this.name; + } + + public Long getId() { + return this.id; + } + + public String getNameDecorated() + { return this.nameDecorated; } + + public String getHierarchy() + { return this.hierarchy; } + + + public String getExternalId() { + return this.externalId; + } + + public int openingDate() { + return this.openingDate; + } + + + } + +