This repository has been archived by the owner on Jun 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,331 additions
and
784 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
154 changes: 154 additions & 0 deletions
154
emfjson-jackson/src/test/java/org/emfjson/jackson/junit/model/GenericContainer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
/** | ||
*/ | ||
package org.emfjson.jackson.junit.model; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
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.EObject; | ||
import org.eclipse.emf.ecore.InternalEObject; | ||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
import org.eclipse.emf.ecore.util.EObjectContainmentEList; | ||
import org.eclipse.emf.ecore.util.InternalEList; | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* A representation of the model object '<em><b>Generic Container</b></em>'. | ||
* <!-- end-user-doc --> | ||
* | ||
* <p> | ||
* The following features are supported: | ||
* </p> | ||
* <ul> | ||
* <li>{@link org.emfjson.jackson.junit.model.GenericContainer#getValues <em>Values</em>}</li> | ||
* </ul> | ||
* | ||
* @generated | ||
*/ | ||
public class GenericContainer extends MinimalEObjectImpl.Container implements EObject { | ||
/** | ||
* The cached value of the '{@link #getValues() <em>Values</em>}' containment reference list. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @see #getValues() | ||
* @generated | ||
* @ordered | ||
*/ | ||
protected EList<GenericType<?>> values; | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
protected GenericContainer() { | ||
super(); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
protected EClass eStaticClass() { | ||
return ModelPackage.Literals.GENERIC_CONTAINER; | ||
} | ||
|
||
/** | ||
* Returns the value of the '<em><b>Values</b></em>' containment reference list. | ||
* The list contents are of type {@link org.emfjson.jackson.junit.model.GenericType}<?>. | ||
* <!-- begin-user-doc --> | ||
* <p> | ||
* If the meaning of the '<em>Values</em>' containment reference isn't clear, | ||
* there really should be more of a description here... | ||
* </p> | ||
* <!-- end-user-doc --> | ||
* @return the value of the '<em>Values</em>' containment reference list. | ||
* @generated | ||
*/ | ||
public List<GenericType<?>> getValues() { | ||
if (values == null) { | ||
values = new EObjectContainmentEList.Resolving<GenericType<?>>(GenericType.class, this, ModelPackage.GENERIC_CONTAINER__VALUES); | ||
} | ||
return values; | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
switch (featureID) { | ||
case ModelPackage.GENERIC_CONTAINER__VALUES: | ||
return ((InternalEList<?>)getValues()).basicRemove(otherEnd, msgs); | ||
} | ||
return super.eInverseRemove(otherEnd, featureID, msgs); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
switch (featureID) { | ||
case ModelPackage.GENERIC_CONTAINER__VALUES: | ||
return getValues(); | ||
} | ||
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 ModelPackage.GENERIC_CONTAINER__VALUES: | ||
getValues().clear(); | ||
getValues().addAll((Collection<? extends GenericType<?>>)newValue); | ||
return; | ||
} | ||
super.eSet(featureID, newValue); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public void eUnset(int featureID) { | ||
switch (featureID) { | ||
case ModelPackage.GENERIC_CONTAINER__VALUES: | ||
getValues().clear(); | ||
return; | ||
} | ||
super.eUnset(featureID); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public boolean eIsSet(int featureID) { | ||
switch (featureID) { | ||
case ModelPackage.GENERIC_CONTAINER__VALUES: | ||
return values != null && !values.isEmpty(); | ||
} | ||
return super.eIsSet(featureID); | ||
} | ||
|
||
} // GenericContainer |
163 changes: 163 additions & 0 deletions
163
emfjson-jackson/src/test/java/org/emfjson/jackson/junit/model/GenericType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
/** | ||
*/ | ||
package org.emfjson.jackson.junit.model; | ||
|
||
import org.eclipse.emf.common.notify.Notification; | ||
|
||
import org.eclipse.emf.ecore.EClass; | ||
import org.eclipse.emf.ecore.EObject; | ||
|
||
import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* A representation of the model object '<em><b>Generic Type</b></em>'. | ||
* <!-- end-user-doc --> | ||
* | ||
* <p> | ||
* The following features are supported: | ||
* </p> | ||
* <ul> | ||
* <li>{@link org.emfjson.jackson.junit.model.GenericType#getValue <em>Value</em>}</li> | ||
* </ul> | ||
* | ||
* @generated | ||
*/ | ||
public abstract class GenericType<T> extends MinimalEObjectImpl.Container implements EObject { | ||
/** | ||
* The cached value of the '{@link #getValue() <em>Value</em>}' attribute. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @see #getValue() | ||
* @generated | ||
* @ordered | ||
*/ | ||
protected T value; | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
protected GenericType() { | ||
super(); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
protected EClass eStaticClass() { | ||
return ModelPackage.Literals.GENERIC_TYPE; | ||
} | ||
|
||
/** | ||
* Returns the value of the '<em><b>Value</b></em>' attribute. | ||
* <!-- begin-user-doc --> | ||
* <p> | ||
* If the meaning of the '<em>Value</em>' attribute isn't clear, | ||
* there really should be more of a description here... | ||
* </p> | ||
* <!-- end-user-doc --> | ||
* @return the value of the '<em>Value</em>' attribute. | ||
* @see #setValue(Object) | ||
* @generated | ||
*/ | ||
public T getValue() { | ||
return value; | ||
} | ||
|
||
/** | ||
* Sets the value of the '{@link org.emfjson.jackson.junit.model.GenericType#getValue <em>Value</em>}' attribute. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @param value the new value of the '<em>Value</em>' attribute. | ||
* @see #getValue() | ||
* @generated | ||
*/ | ||
public void setValue(T newValue) { | ||
T oldValue = value; | ||
value = newValue; | ||
if (eNotificationRequired()) | ||
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.GENERIC_TYPE__VALUE, oldValue, value)); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
switch (featureID) { | ||
case ModelPackage.GENERIC_TYPE__VALUE: | ||
return getValue(); | ||
} | ||
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 ModelPackage.GENERIC_TYPE__VALUE: | ||
setValue((T)newValue); | ||
return; | ||
} | ||
super.eSet(featureID, newValue); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public void eUnset(int featureID) { | ||
switch (featureID) { | ||
case ModelPackage.GENERIC_TYPE__VALUE: | ||
setValue((T)null); | ||
return; | ||
} | ||
super.eUnset(featureID); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public boolean eIsSet(int featureID) { | ||
switch (featureID) { | ||
case ModelPackage.GENERIC_TYPE__VALUE: | ||
return value != null; | ||
} | ||
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(" (value: "); | ||
result.append(value); | ||
result.append(')'); | ||
return result.toString(); | ||
} | ||
|
||
} // GenericType |
Oops, something went wrong.