/** * 2014 Urs Zeidler */ package de.urszeidler.eclipse.shr5.impl; import java.math.BigDecimal; import java.util.Date; 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.MinimalEObjectImpl; import de.urszeidler.eclipse.shr5.CredstickTransaction; import de.urszeidler.eclipse.shr5.Shr5Package; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Credstick Transaction</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link de.urszeidler.eclipse.shr5.impl.CredstickTransactionImpl#getAmount <em>Amount</em>}</li> * <li>{@link de.urszeidler.eclipse.shr5.impl.CredstickTransactionImpl#getDate <em>Date</em>}</li> * <li>{@link de.urszeidler.eclipse.shr5.impl.CredstickTransactionImpl#getDescription <em>Description</em>}</li> * </ul> * </p> * * @generated */ public class CredstickTransactionImpl extends MinimalEObjectImpl.Container implements CredstickTransaction { /** * The default value of the '{@link #getAmount() <em>Amount</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAmount() * @generated * @ordered */ protected static final BigDecimal AMOUNT_EDEFAULT = null; /** * The cached value of the '{@link #getAmount() <em>Amount</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAmount() * @generated * @ordered */ protected BigDecimal amount = AMOUNT_EDEFAULT; /** * The default value of the '{@link #getDate() <em>Date</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDate() * @generated * @ordered */ protected static final Date DATE_EDEFAULT = null; /** * The cached value of the '{@link #getDate() <em>Date</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDate() * @generated * @ordered */ protected Date date = DATE_EDEFAULT; /** * The default value of the '{@link #getDescription() <em>Description</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDescription() * @generated * @ordered */ protected static final String DESCRIPTION_EDEFAULT = null; /** * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDescription() * @generated * @ordered */ protected String description = DESCRIPTION_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected CredstickTransactionImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return Shr5Package.Literals.CREDSTICK_TRANSACTION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public BigDecimal getAmount() { return amount; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setAmount(BigDecimal newAmount) { BigDecimal oldAmount = amount; amount = newAmount; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Shr5Package.CREDSTICK_TRANSACTION__AMOUNT, oldAmount, amount)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Date getDate() { return date; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setDate(Date newDate) { Date oldDate = date; date = newDate; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Shr5Package.CREDSTICK_TRANSACTION__DATE, oldDate, date)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getDescription() { return description; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setDescription(String newDescription) { String oldDescription = description; description = newDescription; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Shr5Package.CREDSTICK_TRANSACTION__DESCRIPTION, oldDescription, description)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case Shr5Package.CREDSTICK_TRANSACTION__AMOUNT: return getAmount(); case Shr5Package.CREDSTICK_TRANSACTION__DATE: return getDate(); case Shr5Package.CREDSTICK_TRANSACTION__DESCRIPTION: return getDescription(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Shr5Package.CREDSTICK_TRANSACTION__AMOUNT: setAmount((BigDecimal)newValue); return; case Shr5Package.CREDSTICK_TRANSACTION__DATE: setDate((Date)newValue); return; case Shr5Package.CREDSTICK_TRANSACTION__DESCRIPTION: setDescription((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Shr5Package.CREDSTICK_TRANSACTION__AMOUNT: setAmount(AMOUNT_EDEFAULT); return; case Shr5Package.CREDSTICK_TRANSACTION__DATE: setDate(DATE_EDEFAULT); return; case Shr5Package.CREDSTICK_TRANSACTION__DESCRIPTION: setDescription(DESCRIPTION_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Shr5Package.CREDSTICK_TRANSACTION__AMOUNT: return AMOUNT_EDEFAULT == null ? amount != null : !AMOUNT_EDEFAULT.equals(amount); case Shr5Package.CREDSTICK_TRANSACTION__DATE: return DATE_EDEFAULT == null ? date != null : !DATE_EDEFAULT.equals(date); case Shr5Package.CREDSTICK_TRANSACTION__DESCRIPTION: return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (amount: "); result.append(amount); result.append(", date: "); result.append(date); result.append(", description: "); result.append(description); result.append(')'); return result.toString(); } } //CredstickTransactionImpl