/*******************************************************************************
 * Copyright © 2004 VHA. All rights reserved
 ******************************************************************************/
package gov.va.med.esr.common.builder.entity.metaData;

// Java Classes

// Library Classes

// Framework Classes

// Common Classes
import gov.va.med.esr.common.builder.datatype.metadata.PN;
import gov.va.med.esr.common.builder.entity.NameMetaData;
import gov.va.med.esr.common.model.person.Name;

// Messaging Classes

public class NameMetaDataFromPN
    extends AbstractMetaData
    implements NameMetaData
{
    private Name entity;

    private PN pn;

    public NameMetaDataFromPN(PN pn)
    {
        super();

        this.pn = pn;
    }

    /*
     * (non-Javadoc)
     * 
     * @see gov.va.med.esr.messaging.builder.entity.NameMetaData#getEntity()
     */
    public Name getEntity()
    {
        return this.entity;
    }

    /*
     * (non-Javadoc)
     * 
     * @see gov.va.med.esr.messaging.builder.entity.NameMetaData#setEntity(gov.va.med.esr.common.model.person.Name)
     */
    public void setEntity(Name entity)
    {
        this.entity = entity;
    }

    /*
     * (non-Javadoc)
     * 
     * @see gov.va.med.esr.messaging.builder.entity.NameMetaData#getDegree()
     */
    public String getDegree()
    {
        return (this.pn == null) ? null : super.getValue(this.pn.getDegree());
    }

    /*
     * (non-Javadoc)
     * 
     * @see gov.va.med.esr.messaging.builder.entity.NameMetaData#getFamilyName()
     */
    public String getFamilyName()
    {
        return (this.pn == null) ? null : super.getValue(this.pn
            .getFamilyName());
    }

    /*
     * (non-Javadoc)
     * 
     * @see gov.va.med.esr.messaging.builder.entity.NameMetaData#getGivenName()
     */
    public String getGivenName()
    {
        return (this.pn == null) ? null : super
            .getValue(this.pn.getGivenName());
    }

    /*
     * (non-Javadoc)
     * 
     * @see gov.va.med.esr.messaging.builder.entity.NameMetaData#getMiddleName()
     */
    public String getMiddleName()
    {
        return (this.pn == null) ? null : super.getValue(this.pn
            .getMiddleName());
    }

    /*
     * (non-Javadoc)
     * 
     * @see gov.va.med.esr.messaging.builder.entity.NameMetaData#getPrefix()
     */
    public String getPrefix()
    {
        return (this.pn == null) ? null : super.getValue(this.pn.getPrefix());
    }

    /*
     * (non-Javadoc)
     * 
     * @see gov.va.med.esr.messaging.builder.entity.NameMetaData#getSuffix()
     */
    public String getSuffix()
    {
        return (this.pn == null) ? null : super.getValue(this.pn.getSuffix());
    }

    /*
     * (non-Javadoc)
     * 
     * @see gov.va.med.esr.messaging.builder.entity.NameMetaData#getType()
     */
    public String getType()
    {
        return null;
    }
}