Upate Office Helper!
This commit is contained in:
+85
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user