diff options
Diffstat (limited to 'sca-java-1.x/tags/java-M1-final/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyTypeImpl.java')
-rw-r--r-- | sca-java-1.x/tags/java-M1-final/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyTypeImpl.java | 303 |
1 files changed, 303 insertions, 0 deletions
diff --git a/sca-java-1.x/tags/java-M1-final/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyTypeImpl.java b/sca-java-1.x/tags/java-M1-final/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyTypeImpl.java new file mode 100644 index 0000000000..76caa0bcdc --- /dev/null +++ b/sca-java-1.x/tags/java-M1-final/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyTypeImpl.java @@ -0,0 +1,303 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.tuscany.das.rdb.test.company.impl; + +import java.util.Collection; +import java.util.List; + +import org.apache.tuscany.das.rdb.test.company.CompanyType; +import org.apache.tuscany.das.rdb.test.company.DepartmentType; + +import org.apache.tuscany.sdo.impl.DataObjectImpl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Type</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl#getDepartments <em>Departments</em>}</li> + * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl#getEmployeeOfTheMonth <em>Employee Of The Month</em>}</li> + * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl#getName <em>Name</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class CompanyTypeImpl extends DataObjectImpl implements CompanyType +{ + /** + * The cached value of the '{@link #getDepartments() <em>Departments</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getDepartments() + * @generated + * @ordered + */ + protected EList departments = null; + + /** + * The default value of the '{@link #getEmployeeOfTheMonth() <em>Employee Of The Month</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getEmployeeOfTheMonth() + * @generated + * @ordered + */ + protected static final String EMPLOYEE_OF_THE_MONTH_EDEFAULT = null; + + /** + * The cached value of the '{@link #getEmployeeOfTheMonth() <em>Employee Of The Month</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getEmployeeOfTheMonth() + * @generated + * @ordered + */ + protected String employeeOfTheMonth = EMPLOYEE_OF_THE_MONTH_EDEFAULT; + + /** + * The default value of the '{@link #getName() <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected CompanyTypeImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected EClass eStaticClass() + { + return CompanyPackageImpl.Literals.COMPANY_TYPE; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public List getDepartments() + { + if (departments == null) + { + departments = new EObjectContainmentEList(DepartmentType.class, this, CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS); + } + return departments; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getEmployeeOfTheMonth() + { + return employeeOfTheMonth; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setEmployeeOfTheMonth(String newEmployeeOfTheMonth) + { + String oldEmployeeOfTheMonth = employeeOfTheMonth; + employeeOfTheMonth = newEmployeeOfTheMonth; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH, oldEmployeeOfTheMonth, employeeOfTheMonth)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getName() + { + return name; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setName(String newName) + { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.COMPANY_TYPE__NAME, oldName, name)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS: + return ((InternalEList)getDepartments()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS: + return getDepartments(); + case CompanyPackageImpl.COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH: + return getEmployeeOfTheMonth(); + case CompanyPackageImpl.COMPANY_TYPE__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS: + getDepartments().clear(); + getDepartments().addAll((Collection)newValue); + return; + case CompanyPackageImpl.COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH: + setEmployeeOfTheMonth((String)newValue); + return; + case CompanyPackageImpl.COMPANY_TYPE__NAME: + setName((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void eUnset(int featureID) + { + switch (featureID) + { + case CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS: + getDepartments().clear(); + return; + case CompanyPackageImpl.COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH: + setEmployeeOfTheMonth(EMPLOYEE_OF_THE_MONTH_EDEFAULT); + return; + case CompanyPackageImpl.COMPANY_TYPE__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS: + return departments != null && !departments.isEmpty(); + case CompanyPackageImpl.COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH: + return EMPLOYEE_OF_THE_MONTH_EDEFAULT == null ? employeeOfTheMonth != null : !EMPLOYEE_OF_THE_MONTH_EDEFAULT.equals(employeeOfTheMonth); + case CompanyPackageImpl.COMPANY_TYPE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String toString() + { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (employeeOfTheMonth: "); + result.append(employeeOfTheMonth); + result.append(", name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //CompanyTypeImpl |