/* Copyright © 2014 VHA. All rights reserved
*******************************************************************
**
 * 
 * @author DNS   zhangs
 *
********************************************************************/
package gov.va.med.esr.common.builder.entity.metaData;


// Common Classes
import gov.va.med.esr.common.builder.datatype.metadata.CE;
import gov.va.med.esr.common.builder.entity.CDDescriptorMetaData;
import gov.va.med.esr.common.model.ee.CDDescriptor;

// Messaging Classes


public class CDDescriptorMetaDataFromCE
    extends AbstractMetaData
    implements CDDescriptorMetaData
{
    private CDDescriptor entity;

    private CE descriptor;

    public CDDescriptorMetaDataFromCE(CE ce)
    {
        super();

        this.descriptor = ce;
    }

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

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

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

