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

org.jboss.drools.impl.ParameterValueImpl Maven / Gradle / Ivy

/**
 */
package org.jboss.drools.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.jboss.drools.DroolsPackage;
import org.jboss.drools.ParameterValue;
import org.jboss.drools.ResultType;

/**
 * 
 * An implementation of the model object 'Parameter Value'.
 * 
 * 

* The following features are implemented: *

    *
  • {@link org.jboss.drools.impl.ParameterValueImpl#getInstance Instance}
  • *
  • {@link org.jboss.drools.impl.ParameterValueImpl#getResult Result}
  • *
  • {@link org.jboss.drools.impl.ParameterValueImpl#getValidFor Valid For}
  • *
*

* * @generated */ public class ParameterValueImpl extends EObjectImpl implements ParameterValue { /** * The default value of the '{@link #getInstance() Instance}' attribute. * * * @see #getInstance() * @generated * @ordered */ protected static final String INSTANCE_EDEFAULT = null; /** * The cached value of the '{@link #getInstance() Instance}' attribute. * * * @see #getInstance() * @generated * @ordered */ protected String instance = INSTANCE_EDEFAULT; /** * The default value of the '{@link #getResult() Result}' attribute. * * * @see #getResult() * @generated * @ordered */ protected static final ResultType RESULT_EDEFAULT = ResultType.ENUM; /** * The cached value of the '{@link #getResult() Result}' attribute. * * * @see #getResult() * @generated * @ordered */ protected ResultType result = RESULT_EDEFAULT; /** * This is true if the Result attribute has been set. * * * @generated * @ordered */ protected boolean resultESet; /** * The default value of the '{@link #getValidFor() Valid For}' attribute. * * * @see #getValidFor() * @generated * @ordered */ protected static final String VALID_FOR_EDEFAULT = null; /** * The cached value of the '{@link #getValidFor() Valid For}' attribute. * * * @see #getValidFor() * @generated * @ordered */ protected String validFor = VALID_FOR_EDEFAULT; /** * * * @generated */ protected ParameterValueImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return DroolsPackage.Literals.PARAMETER_VALUE; } /** * * * @generated */ public String getInstance() { return instance; } /** * * * @generated */ public void setInstance(String newInstance) { String oldInstance = instance; instance = newInstance; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DroolsPackage.PARAMETER_VALUE__INSTANCE, oldInstance, instance)); } /** * * * @generated */ public ResultType getResult() { return result; } /** * * * @generated */ public void setResult(ResultType newResult) { ResultType oldResult = result; result = newResult == null ? RESULT_EDEFAULT : newResult; boolean oldResultESet = resultESet; resultESet = true; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DroolsPackage.PARAMETER_VALUE__RESULT, oldResult, result, !oldResultESet)); } /** * * * @generated */ public void unsetResult() { ResultType oldResult = result; boolean oldResultESet = resultESet; result = RESULT_EDEFAULT; resultESet = false; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.UNSET, DroolsPackage.PARAMETER_VALUE__RESULT, oldResult, RESULT_EDEFAULT, oldResultESet)); } /** * * * @generated */ public boolean isSetResult() { return resultESet; } /** * * * @generated */ public String getValidFor() { return validFor; } /** * * * @generated */ public void setValidFor(String newValidFor) { String oldValidFor = validFor; validFor = newValidFor; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DroolsPackage.PARAMETER_VALUE__VALID_FOR, oldValidFor, validFor)); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case DroolsPackage.PARAMETER_VALUE__INSTANCE: return getInstance(); case DroolsPackage.PARAMETER_VALUE__RESULT: return getResult(); case DroolsPackage.PARAMETER_VALUE__VALID_FOR: return getValidFor(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DroolsPackage.PARAMETER_VALUE__INSTANCE: setInstance((String)newValue); return; case DroolsPackage.PARAMETER_VALUE__RESULT: setResult((ResultType)newValue); return; case DroolsPackage.PARAMETER_VALUE__VALID_FOR: setValidFor((String)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DroolsPackage.PARAMETER_VALUE__INSTANCE: setInstance(INSTANCE_EDEFAULT); return; case DroolsPackage.PARAMETER_VALUE__RESULT: unsetResult(); return; case DroolsPackage.PARAMETER_VALUE__VALID_FOR: setValidFor(VALID_FOR_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DroolsPackage.PARAMETER_VALUE__INSTANCE: return INSTANCE_EDEFAULT == null ? instance != null : !INSTANCE_EDEFAULT.equals(instance); case DroolsPackage.PARAMETER_VALUE__RESULT: return isSetResult(); case DroolsPackage.PARAMETER_VALUE__VALID_FOR: return VALID_FOR_EDEFAULT == null ? validFor != null : !VALID_FOR_EDEFAULT.equals(validFor); } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (instance: "); result.append(instance); result.append(", result: "); if (resultESet) result.append(result); else result.append(""); result.append(", validFor: "); result.append(validFor); result.append(')'); return result.toString(); } } //ParameterValueImpl




© 2015 - 2025 Weber Informatics LLC | Privacy Policy