Skip to content

Commit

Permalink
Add sought for
Browse files Browse the repository at this point in the history
Signed-off-by: Kyrill Zotkin <143617+kyrillzotkin@users.noreply.github.com>
  • Loading branch information
kyrillzotkin committed Oct 6, 2024
1 parent 49240f8 commit cac4875
Showing 1 changed file with 279 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
/**
* Copyright 2023 Kyrill Zotkin
*
* 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.enterprisedomain.classmaker.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.BasicEMap;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.EMap;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EObjectEList;
import org.enterprisedomain.classmaker.ClassMakerPackage;
import org.enterprisedomain.classmaker.StageQualifier;
import org.enterprisedomain.classmaker.jobs.Worker;

/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Stage
* Qualifier To Workers Map Entry</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.enterprisedomain.classmaker.impl.StageQualifierToWorkersMapEntryImpl#getTypedKey <em>Key</em>}</li>
* <li>{@link org.enterprisedomain.classmaker.impl.StageQualifierToWorkersMapEntryImpl#getTypedValue <em>Value</em>}</li>
* </ul>
*
* @generated
*/
public class StageQualifierToWorkersMapEntryImpl extends EObjectImpl
implements BasicEMap.Entry<StageQualifier, EList<Worker>> {
/**
* The cached value of the '{@link #getTypedKey() <em>Key</em>}' reference. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see #getTypedKey()
* @generated
* @ordered
*/
protected StageQualifier key;

/**
* The cached value of the '{@link #getTypedValue() <em>Value</em>}' reference list.
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @see #getTypedValue()
* @generated
* @ordered
*/
protected EList<Worker> value;

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
protected StageQualifierToWorkersMapEntryImpl() {
super();
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ClassMakerPackage.Literals.STAGE_QUALIFIER_TO_WORKERS_MAP_ENTRY;
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public StageQualifier getTypedKey() {
if (key != null && key.eIsProxy()) {
InternalEObject oldKey = (InternalEObject) key;
key = (StageQualifier) eResolveProxy(oldKey);
if (key != oldKey) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
ClassMakerPackage.STAGE_QUALIFIER_TO_WORKERS_MAP_ENTRY__KEY, oldKey, key));
}
}
return key;
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public StageQualifier basicGetTypedKey() {
return key;
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public void setTypedKey(StageQualifier newKey) {
StageQualifier oldKey = key;
key = newKey;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
ClassMakerPackage.STAGE_QUALIFIER_TO_WORKERS_MAP_ENTRY__KEY, oldKey, key));
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public EList<Worker> getTypedValue() {
if (value == null) {
value = new EObjectEList<Worker>(Worker.class, this,
ClassMakerPackage.STAGE_QUALIFIER_TO_WORKERS_MAP_ENTRY__VALUE);
}
return value;
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ClassMakerPackage.STAGE_QUALIFIER_TO_WORKERS_MAP_ENTRY__KEY:
if (resolve)
return getTypedKey();
return basicGetTypedKey();
case ClassMakerPackage.STAGE_QUALIFIER_TO_WORKERS_MAP_ENTRY__VALUE:
return getTypedValue();
}
return super.eGet(featureID, resolve, coreType);
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ClassMakerPackage.STAGE_QUALIFIER_TO_WORKERS_MAP_ENTRY__KEY:
setTypedKey((StageQualifier) newValue);
return;
case ClassMakerPackage.STAGE_QUALIFIER_TO_WORKERS_MAP_ENTRY__VALUE:
getTypedValue().clear();
getTypedValue().addAll((Collection<? extends Worker>) newValue);
return;
}
super.eSet(featureID, newValue);
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ClassMakerPackage.STAGE_QUALIFIER_TO_WORKERS_MAP_ENTRY__KEY:
setTypedKey((StageQualifier) null);
return;
case ClassMakerPackage.STAGE_QUALIFIER_TO_WORKERS_MAP_ENTRY__VALUE:
getTypedValue().clear();
return;
}
super.eUnset(featureID);
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ClassMakerPackage.STAGE_QUALIFIER_TO_WORKERS_MAP_ENTRY__KEY:
return key != null;
case ClassMakerPackage.STAGE_QUALIFIER_TO_WORKERS_MAP_ENTRY__VALUE:
return value != null && !value.isEmpty();
}
return super.eIsSet(featureID);
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
protected int hash = -1;

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public int getHash() {
if (hash == -1) {
Object theKey = getKey();
hash = (theKey == null ? 0 : theKey.hashCode());
}
return hash;
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public void setHash(int hash) {
this.hash = hash;
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public StageQualifier getKey() {
return getTypedKey();
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public void setKey(StageQualifier key) {
setTypedKey(key);
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Worker> getValue() {
return getTypedValue();
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Worker> setValue(EList<Worker> value) {
EList<Worker> oldValue = getValue();
getTypedValue().clear();
getTypedValue().addAll(value);
return oldValue;
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
public EMap<StageQualifier, EList<Worker>> getEMap() {
EObject container = eContainer();
return container == null ? null : (EMap<StageQualifier, EList<Worker>>) container.eGet(eContainmentFeature());
}

} // StageQualifierToWorkersMapEntryImpl

0 comments on commit cac4875

Please sign in to comment.