All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.epos.eposdatamodel.ContactPoint Maven / Gradle / Ivy

There is a newer version: 2.5.21
Show newest version
package org.epos.eposdatamodel;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * A Contact Point of a Class. it can be refered to phisical person or an organization
 */
public class ContactPoint extends EPOSDataModelEntity {

    /**
     * This property refers to the Contact Point Email.
     **/
    private List email = null;

    /**
     * This property contains information about the language used by the Contact
     * Point. Please use one of the language codes from the IETF BCP 47 standard.
     */
    private List language = null;

    /**
     * This property refers to the Contact Point role.
     **/
    private String role = null;

    /**
     * This property refers to the related Organization which represents the contactpoint.
     */
    private LinkedEntity organization = null;

    /**
     * This property refers to the related Person which represents the contact point.
     */
    private LinkedEntity person = null;

    /**
     * This property refers to the Contact Point Telephone.
     **/
    private List telephone = null;

    public void addEmail(String email) {
        if (this.email == null) {
            ArrayList emailList = new ArrayList<>();
            emailList.add(email);
            this.setEmail(emailList);
        } else {
            this.email.add(email);
        }
    }

    public void addTelephone(String telephone) {
        if (this.telephone == null) {
            ArrayList telephoneList = new ArrayList<>();
            telephoneList.add(telephone);
            this.setTelephone(telephoneList);
        } else {
            this.telephone.add(telephone);
        }
    }

    public void addLanguage(String language) {
        if (this.language == null) {
            ArrayList languageList = new ArrayList<>();
            languageList.add(language);
            this.setLanguage(languageList);
        } else {
            this.language.add(language);
        }
    }


    public ContactPoint email(List email) {
        this.email = email;
        return this;
    }

    public ContactPoint addEmailItem(String emailItem) {
        if (this.email == null) {
            this.email = new ArrayList<>();
        }
        this.email.add(emailItem);
        return this;
    }

    /**
     * This property refers to the Contact Point Email.
     *
     * @return email
     **/

    public List getEmail() {
        return email;
    }

    public void setEmail(List email) {
        this.email = email;
    }

    public List getLanguage() {
        return language;
    }

    public void setLanguage(List language) {
        this.language = language;
    }

    public ContactPoint role(String role) {
        this.role = role;
        return this;
    }

    /**
     * This property refers to the Contact Point role.
     *
     * @return role
     **/

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public ContactPoint telephone(List telephone) {
        this.telephone = telephone;
        return this;
    }

    public ContactPoint addTelephoneItem(String telephoneItem) {
        if (this.telephone == null) {
            this.telephone = new ArrayList<>();
        }
        this.telephone.add(telephoneItem);
        return this;
    }

    /**
     * This property refers to the Contact Point Telephone.
     *
     * @return telephone
     **/

    public List getTelephone() {
        return telephone;
    }

    public void setTelephone(List telephone) {
        this.telephone = telephone;
    }


    public LinkedEntity getOrganization() {
        return organization;
    }

    public void setOrganization(LinkedEntity organization) {
        this.organization = organization;
    }

    public LinkedEntity getPerson() {
        return person;
    }

    public void setPerson(LinkedEntity person) {
        this.person = person;
    }

    @Override
    public String toString() {
        return "ContactPoint{ email=" + email +
                ", language='" + language + '\'' +
                ", role='" + role + '\'' +
                ", organization=" + organization +
                ", person=" + person +
                ", telephone=" + telephone +
                "} " + super.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        ContactPoint that = (ContactPoint) o;
        return Objects.equals(getEmail(), that.getEmail()) && Objects.equals(getLanguage(), that.getLanguage()) && Objects.equals(getRole(), that.getRole()) && Objects.equals(getOrganization(), that.getOrganization()) && Objects.equals(getPerson(), that.getPerson()) && Objects.equals(getTelephone(), that.getTelephone());
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), getEmail(), getLanguage(), getRole(), getOrganization(), getPerson(), getTelephone());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy