com.sfs.whichdoctor.beans.AddressVerificationBean.java Source code

Java tutorial

Introduction

Here is the source code for com.sfs.whichdoctor.beans.AddressVerificationBean.java

Source

/*******************************************************************************
 * Copyright (c) 2011 David Harrison.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl-3.0.html
 *
 * Contributors:
 *     David Harrison - initial API and implementation
 ******************************************************************************/
package com.sfs.whichdoctor.beans;

import java.util.Date;

import org.apache.commons.lang.StringUtils;

/**
 * The Class AddressVerificatonBean.
 *
 * @author David Harrison 22nd September 2011
 */
public class AddressVerificationBean implements java.io.Serializable {

    /** The Constant serialVersionUID. */
    private static final long serialVersionUID = 1241112L;

    /** The address verification id */
    private int addressVerificationId;

    /** The address GUID. */
    private int addressGUID;

    /** The reference guid. */
    private int referenceGUID;

    /** The person identifier. */
    private int personIdentifier;

    /** The person name. */
    private String personName;

    /** The organisation name. */
    private String organisationName;

    /** The input address. */
    private AddressBean inputAddress = new AddressBean();

    /** The output address. */
    private AddressBean outputAddress = new AddressBean();

    /** The return code. */
    private String returnCode;

    /** The return code extension. */
    private String returnCodeExtension;

    /** The process status. */
    private String processStatus;

    /** The processing exception. */
    private String processingException;

    /** The created date. */
    private Date createdDate;

    /**
     * Gets the address verification id.
     *
     * @return the address verification id
     */
    public final int getAddressVerificationId() {
        return addressVerificationId;
    }

    /**
     * Sets the address verification id.
     *
     * @param addressVerificationIdVal the new address verification id value
     */
    public final void setAddressVerificationId(final int addressVerificationIdVal) {
        this.addressVerificationId = addressVerificationIdVal;
    }

    /**
     * Gets the address guid.
     *
     * @return the address guid
     */
    public final int getAddressGUID() {
        return addressGUID;
    }

    /**
     * Sets the address guid.
     *
     * @param addressGUIDVal the new address guid
     */
    public final void setAddressGUID(final int addressGUIDVal) {
        this.addressGUID = addressGUIDVal;
    }

    /**
     * Gets the reference guid.
     *
     * @return the reference guid
     */
    public final int getReferenceGUID() {
        return referenceGUID;
    }

    /**
     * Sets the reference guid.
     *
     * @param referenceGUIDVal the new reference guid
     */
    public final void setReferenceGUID(final int referenceGUIDVal) {
        this.referenceGUID = referenceGUIDVal;
    }

    /**
     * Gets the person identifier.
     *
     * @return the person identifier
     */
    public final int getPersonIdentifier() {
        return personIdentifier;
    }

    /**
     * Sets the person identifier.
     *
     * @param personIdentifierVal the new person identifier
     */
    public final void setPersonIdentifier(final int personIdentifierVal) {
        this.personIdentifier = personIdentifierVal;
    }

    /**
     * Gets the person name.
     *
     * @return the person name
     */
    public final String getPersonName() {
        if (personName == null) {
            personName = "";
        }
        return personName;
    }

    /**
     * Sets the person name.
     *
     * @param personNameVal the new person name
     */
    public final void setPersonName(final String personNameVal) {
        this.personName = personNameVal;
    }

    /**
     * Gets the organisation name.
     *
     * @return the organisation name
     */
    public final String getOrganisationName() {
        if (organisationName == null) {
            organisationName = "";
        }
        return organisationName;
    }

    /**
     * Sets the organisation name.
     *
     * @param organisationNameVal the new organisation name
     */
    public final void setOrganisationName(final String organisationNameVal) {
        this.organisationName = organisationNameVal;
    }

    /**
     * Gets the input address.
     *
     * @return the input address
     */
    public final AddressBean getInputAddress() {
        return inputAddress;
    }

    /**
     * Sets the input address.
     *
     * @param inputAddressVal the new input address
     */
    public final void setInputAddress(final AddressBean inputAddressVal) {
        this.inputAddress = inputAddressVal;
    }

    /**
     * Gets the output address.
     *
     * @return the output address
     */
    public final AddressBean getOutputAddress() {
        return outputAddress;
    }

    /**
     * Sets the output address.
     *
     * @param outputAddressVal the new output address
     */
    public final void setOutputAddress(final AddressBean outputAddressVal) {
        this.outputAddress = outputAddressVal;
    }

    /**
     * Gets the return code.
     *
     * @return the return code
     */
    public final String getReturnCode() {
        if (returnCode == null) {
            returnCode = "";
        }
        return returnCode;
    }

    /**
     * Sets the return code.
     *
     * @param returnCodeVal the new return code
     */
    public final void setReturnCode(final String returnCodeVal) {
        this.returnCode = returnCodeVal;
    }

    /**
     * Gets the return code extension.
     *
     * @return the return code extension
     */
    public final String getReturnCodeExtension() {
        if (returnCodeExtension == null) {
            returnCodeExtension = "";
        }
        return returnCodeExtension;
    }

    /**
     * Sets the return code extension.
     *
     * @param returnCodeExtensionVal the new return code extension
     */
    public final void setReturnCodeExtension(final String returnCodeExtensionVal) {
        this.returnCodeExtension = returnCodeExtensionVal;
    }

    /**
     * Gets the process status.
     *
     * @return the process status
     */
    public final String getProcessStatus() {
        return this.processStatus;
    }

    /**
     * Sets the process status value.
     *
     * @param processStatusVal the new process status value
     */
    public final void setProcessStatus(final String processStatusVal) {
        this.processStatus = processStatusVal;
    }

    /**
     * Checks if this verification record is processed.
     *
     * @return true, if is processed
     */
    public final boolean isProcessed() {
        boolean processed = true;
        if (StringUtils.startsWithIgnoreCase(this.getProcessStatus(), "Pending")) {
            processed = false;
        }
        return processed;
    }

    /**
     * Gets the processing exception.
     *
     * @return the processing exception
     */
    public final String getProcessingException() {
        if (processingException == null) {
            processingException = "";
        }
        return processingException;
    }

    /**
     * Sets the processing exception.
     *
     * @param processingExceptionVal the new processing exception
     */
    public final void setProcessingException(final String processingExceptionVal) {
        this.processingException = processingExceptionVal;
    }

    /**
     * Gets the created date.
     *
     * @return the created date
     */
    public final Date getCreatedDate() {
        return createdDate;
    }

    /**
     * Sets the created date.
     *
     * @param createdDateVal the created date
     */
    public final void setCreatedDate(final Date createdDateVal) {
        if (createdDateVal != null) {
            this.createdDate = new Date(createdDateVal.getTime());
        }
    }
}