Search in sources :

Example 1 with ReadablePhone

use of gov.ca.cwds.data.ReadablePhone in project api-core by ca-cwds.

the class BaseAttorney method getPhones.

// =======================
// ApiMultiplePhonesAware:
// =======================
@JsonIgnore
@Override
@Transient
public ApiPhoneAware[] getPhones() {
    List<ApiPhoneAware> phones = new ArrayList<>();
    if (this.primaryPhoneNumber != null && this.messagePhoneNumber != 0) {
        phones.add(new ReadablePhone(null, String.valueOf(this.primaryPhoneNumber), this.primaryPhoneExtensionNumber != null ? this.primaryPhoneExtensionNumber.toString() : null, null));
    }
    if (this.messagePhoneNumber != null && this.messagePhoneNumber != 0) {
        LOGGER.debug("add message phone");
        phones.add(new ReadablePhone(null, String.valueOf(this.messagePhoneNumber), this.messagePhoneExtensionNumber != null ? this.messagePhoneExtensionNumber.toString() : null, ApiPhoneAware.PhoneType.Cell));
    }
    return phones.toArray(new ApiPhoneAware[0]);
}
Also used : ReadablePhone(gov.ca.cwds.data.ReadablePhone) ApiPhoneAware(gov.ca.cwds.data.std.ApiPhoneAware) ArrayList(java.util.ArrayList) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore) Transient(java.beans.Transient)

Aggregations

JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)1 ReadablePhone (gov.ca.cwds.data.ReadablePhone)1 ApiPhoneAware (gov.ca.cwds.data.std.ApiPhoneAware)1 Transient (java.beans.Transient)1 ArrayList (java.util.ArrayList)1