/*
Copyright 2002-2006 The Members of the OSS through Java(TM) Initiative.
All rights reserved. Use is subject to license terms.
*/
package ossj.common.ex;

import ossj.common.AttributeManager;
import ossj.common.Utils;


/**
 * An implementation class for the <CODE>ossj.common.ex.ResetAllVrfNamesValue</CODE> interface.  
 * 
 * @see javax.oss.AttributeAccess
 * 
 * @see ossj.common.ex.ResetAllVrfNamesValue
 * 
 * @author OSS through Java(tm) Initiative, Vincent Perrot Sun Microsystems Inc.
 * @version 1.3 
 * @since January 2006 
 */


public class ResetAllVrfNamesValueImpl
extends ossj.common.UpdateProcedureValueImpl
implements ResetAllVrfNamesValue
{ 

    /**
     * Constructs a new ResetAllVrfNamesValueImpl with empty attributes.
     * 
     */

    public ResetAllVrfNamesValueImpl() {
        super();
        initAttributeTypes();
    }
    
    public ResetAllVrfNamesValueImpl(String value) {
        super();
        initAttributeTypes();
        setVrfName(value);
    }

    private static final String[] attributeNames = {
        ResetAllVrfNamesValue.VRF_NAME
    };

    private static final String[] settableAttributeNames = {
        ResetAllVrfNamesValue.VRF_NAME
    };

    //
    // Configuration of AttributeManager and AttributeAccess
    //
    protected void addAttributesTo(AttributeManager anAttributeManager) {
        if (ResetAllVrfNamesValueImpl.attributeNames != null) {
            anAttributeManager.addAttributes(this.attributeNames);
            super.addAttributesTo(anAttributeManager);
        }
    }

    protected void configureAttributes(AttributeManager anAttributeManager) {
        if (ResetAllVrfNamesValueImpl.settableAttributeNames != null) {
            anAttributeManager.setSettableAttributes(ResetAllVrfNamesValueImpl.settableAttributeNames);
            super.configureAttributes(anAttributeManager);
        }
    }

    /**
     * Holds the Attribute manager that manage the optional fields
    */
    private static AttributeManager attributemanager = null;

    protected AttributeManager getAttributeManager() {
        return attributemanager;
    }
    protected AttributeManager makeAttributeManager() {
        attributemanager = new AttributeManager();
        return attributemanager;
    }

    /**
     * Init the Map Attribute Name/Attribute Type
     * Init the enumeration Map
     */
    protected void initAttributeTypes(){
        String[] list = new String[1];
        list[0] = "java.lang.String";
        addAttributeTypes("vrfName", list);
    }

    private java.lang.String _resetallvrfnamesvalueimpl_vrfName = null;


    /**
     * Changes the vrfName to be equal to the given argument.
     * 
     * This method support a null argument.
     * 
     * @param value the new vrfName for this object.
     * @exception java.lang.IllegalArgumentException - Is thrown to report
     * that a bad argument was provided to the method.
    */

    public void setVrfName(java.lang.String value)
    throws java.lang.IllegalArgumentException    {
        setDirtyAttribute(ResetAllVrfNamesValue.VRF_NAME);
        _resetallvrfnamesvalueimpl_vrfName = value;
    }


    /**
     * Returns this ResetAllVrfNamesValueImpl's vrfName
     * 
     * @return the vrfName
     * 
    */

    public java.lang.String getVrfName()
    throws java.lang.IllegalStateException {
        checkAttribute(ResetAllVrfNamesValue.VRF_NAME);
        return _resetallvrfnamesvalueimpl_vrfName;
    }

    /**
     * Creates a new object of the same class and with the same contents as this object.
     * @return a clone of this instance.
    */
    public Object clone() {
        ResetAllVrfNamesValue val = null;
            val = (ResetAllVrfNamesValue)super.clone();

            if( isPopulated(ResetAllVrfNamesValue.VRF_NAME)) {
                if( this.getVrfName()!=null) 
                    val.setVrfName(((java.lang.String) new String( this.getVrfName())));
                else
                    val.setVrfName( null );
            }

            return val;
    }

    /**
     * Checks whether two ResetAllVrfNamesValue are equal.
     * The result is true if and only if the argument is not null 
     * and is an ResetAllVrfNamesValue object that has the arguments.
     * 
     * @param value the Object to compare with this ResetAllVrfNamesValue
     * @return if the objects are equal; false otherwise.
     */

    public boolean equals (Object value) {
        if ( this == value ){ return true;}
        if ( (value != null) && ( value instanceof ResetAllVrfNamesValue)) {
            ResetAllVrfNamesValue argVal = (ResetAllVrfNamesValue) value;
            return Utils.compareAttributeAccess( this, argVal );
        }
        return false;
    }

}
