recommiting to give clean git status after pull
This commit is contained in:
@@ -1,157 +1,157 @@
|
|||||||
package org.mifosng.platform.api.data;
|
package org.mifosng.platform.api.data;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FIXME - KW - make ClientData immutable without needs for getter/setters as is mostly intended for conversion back to JSON.
|
* FIXME - KW - make ClientData immutable without needs for getter/setters as is mostly intended for conversion back to JSON.
|
||||||
*/
|
*/
|
||||||
public class ClientData {
|
public class ClientData {
|
||||||
|
|
||||||
private final Long id;
|
private final Long id;
|
||||||
private final String firstname;
|
private final String firstname;
|
||||||
private final String lastname;
|
private final String lastname;
|
||||||
private final String clientOrBusinessName;
|
private final String clientOrBusinessName;
|
||||||
private final String displayName;
|
private final String displayName;
|
||||||
private final Long officeId;
|
private final Long officeId;
|
||||||
private final String officeName;
|
private final String officeName;
|
||||||
private final String externalId;
|
private final String externalId;
|
||||||
private final LocalDate joinedDate;
|
private final LocalDate joinedDate;
|
||||||
private final String imageKey;
|
private final String imageKey;
|
||||||
private boolean imagePresent;
|
private boolean imagePresent;
|
||||||
|
|
||||||
private List<OfficeLookup> allowedOffices = new ArrayList<OfficeLookup>();
|
private List<OfficeLookup> allowedOffices = new ArrayList<OfficeLookup>();
|
||||||
|
|
||||||
public static ClientData clientIdentifier(
|
public static ClientData clientIdentifier(
|
||||||
final Long id,
|
final Long id,
|
||||||
final String firstname,
|
final String firstname,
|
||||||
final String lastname,
|
final String lastname,
|
||||||
final Long officeId,
|
final Long officeId,
|
||||||
final String officeName) {
|
final String officeName) {
|
||||||
|
|
||||||
StringBuilder displayNameBuilder = new StringBuilder(firstname);
|
StringBuilder displayNameBuilder = new StringBuilder(firstname);
|
||||||
if (StringUtils.isNotBlank(displayNameBuilder.toString())) {
|
if (StringUtils.isNotBlank(displayNameBuilder.toString())) {
|
||||||
displayNameBuilder.append(' ');
|
displayNameBuilder.append(' ');
|
||||||
}
|
}
|
||||||
displayNameBuilder.append(lastname);
|
displayNameBuilder.append(lastname);
|
||||||
|
|
||||||
return new ClientData(officeId, officeName, id, firstname, lastname, displayNameBuilder.toString(), null, null, null);
|
return new ClientData(officeId, officeName, id, firstname, lastname, displayNameBuilder.toString(), null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClientData(final Long officeId, final String officeName,
|
public ClientData(final Long officeId, final String officeName,
|
||||||
final Long id, final String firstname, final String lastname,
|
final Long id, final String firstname, final String lastname,
|
||||||
final String displayName, final String externalId,
|
final String displayName, final String externalId,
|
||||||
final LocalDate joinedDate,
|
final LocalDate joinedDate,
|
||||||
final String imageKey) {
|
final String imageKey) {
|
||||||
this.officeId = officeId;
|
this.officeId = officeId;
|
||||||
this.officeName = officeName;
|
this.officeName = officeName;
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.firstname = firstname;
|
this.firstname = firstname;
|
||||||
this.displayName = displayName;
|
this.displayName = displayName;
|
||||||
|
|
||||||
/*** unset last name for business name **/
|
/*** unset last name for business name **/
|
||||||
if (StringUtils.isBlank(this.firstname)) {
|
if (StringUtils.isBlank(this.firstname)) {
|
||||||
this.lastname = null;
|
this.lastname = null;
|
||||||
this.clientOrBusinessName = lastname;
|
this.clientOrBusinessName = lastname;
|
||||||
} else {
|
} else {
|
||||||
this.lastname = lastname;
|
this.lastname = lastname;
|
||||||
this.clientOrBusinessName = null;
|
this.clientOrBusinessName = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.externalId = externalId;
|
this.externalId = externalId;
|
||||||
this.joinedDate = joinedDate;
|
this.joinedDate = joinedDate;
|
||||||
this.imageKey = imageKey;
|
this.imageKey = imageKey;
|
||||||
if (imageKey == null) {
|
if (imageKey == null) {
|
||||||
imagePresent = false;
|
imagePresent = false;
|
||||||
}else{
|
}else{
|
||||||
imagePresent = true;
|
imagePresent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClientData(final Long officeId, final LocalDate joinedDate,
|
public ClientData(final Long officeId, final LocalDate joinedDate,
|
||||||
final List<OfficeLookup> offices) {
|
final List<OfficeLookup> offices) {
|
||||||
this.id = null;
|
this.id = null;
|
||||||
this.officeId = officeId;
|
this.officeId = officeId;
|
||||||
this.officeName = null;
|
this.officeName = null;
|
||||||
this.firstname = null;
|
this.firstname = null;
|
||||||
this.lastname = null;
|
this.lastname = null;
|
||||||
this.clientOrBusinessName = null;
|
this.clientOrBusinessName = null;
|
||||||
this.displayName = null;
|
this.displayName = null;
|
||||||
this.externalId = null;
|
this.externalId = null;
|
||||||
this.joinedDate = joinedDate;
|
this.joinedDate = joinedDate;
|
||||||
this.allowedOffices = offices;
|
this.allowedOffices = offices;
|
||||||
this.imageKey = null;
|
this.imageKey = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getOfficeId() {
|
public Long getOfficeId() {
|
||||||
return officeId;
|
return officeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOfficeName() {
|
public String getOfficeName() {
|
||||||
return officeName;
|
return officeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFirstname() {
|
public String getFirstname() {
|
||||||
return firstname;
|
return firstname;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLastname() {
|
public String getLastname() {
|
||||||
return lastname;
|
return lastname;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getClientOrBusinessName() {
|
public String getClientOrBusinessName() {
|
||||||
return clientOrBusinessName;
|
return clientOrBusinessName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDisplayName() {
|
public String getDisplayName() {
|
||||||
return displayName;
|
return displayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getExternalId() {
|
public String getExternalId() {
|
||||||
return externalId;
|
return externalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LocalDate getJoinedDate() {
|
public LocalDate getJoinedDate() {
|
||||||
return joinedDate;
|
return joinedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<OfficeLookup> getAllowedOffices() {
|
public List<OfficeLookup> getAllowedOffices() {
|
||||||
return allowedOffices;
|
return allowedOffices;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAllowedOffices(List<OfficeLookup> allowedOffices) {
|
public void setAllowedOffices(List<OfficeLookup> allowedOffices) {
|
||||||
this.allowedOffices = allowedOffices;
|
this.allowedOffices = allowedOffices;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String displayName() {
|
public String displayName() {
|
||||||
return this.displayName;
|
return this.displayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String officeName() {
|
public String officeName() {
|
||||||
return this.officeName;
|
return this.officeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getImageKey() {
|
public String getImageKey() {
|
||||||
return imageKey;
|
return imageKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isImagePresent() {
|
public boolean isImagePresent() {
|
||||||
return imagePresent;
|
return imagePresent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setImagePresent(boolean imagePresent) {
|
public void setImagePresent(boolean imagePresent) {
|
||||||
this.imagePresent = imagePresent;
|
this.imagePresent = imagePresent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user