blob: 469629dceb1264086a892a4c8c411a3df49cf7dc [file] [log] [blame]
/*
* Copyright (c) 2019 Ed Merks and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Ed Merks - initial API and implementation
*/
package org.eclipse.oomph.junit;
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;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Problem Type</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link org.eclipse.oomph.junit.ProblemType#getValue <em>Value</em>}</li>
* <li>{@link org.eclipse.oomph.junit.ProblemType#getMessage <em>Message</em>}</li>
* <li>{@link org.eclipse.oomph.junit.ProblemType#getType <em>Type</em>}</li>
* </ul>
*
* @see org.eclipse.oomph.junit.JUnitPackage#getProblemType()
* @model kind="class"
* extendedMetaData="name='problem_._type' kind='simple'"
* @generated
*/
public class ProblemType extends MinimalEObjectImpl.Container
{
/**
* The default value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected static final String VALUE_EDEFAULT = null;
/**
* The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected String value = VALUE_EDEFAULT;
/**
* The default value of the '{@link #getMessage() <em>Message</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMessage()
* @generated
* @ordered
*/
protected static final String MESSAGE_EDEFAULT = null;
/**
* The cached value of the '{@link #getMessage() <em>Message</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMessage()
* @generated
* @ordered
*/
protected String message = MESSAGE_EDEFAULT;
/**
* The default value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected static final String TYPE_EDEFAULT = null;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected String type = TYPE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ProblemType()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return JUnitPackage.Literals.PROBLEM_TYPE;
}
/**
* Returns the value of the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Value</em>' attribute.
* @see #setValue(String)
* @see org.eclipse.oomph.junit.JUnitPackage#getProblemType_Value()
* @model extendedMetaData="name=':0' kind='simple'"
* @generated
*/
public String getValue()
{
return value;
}
/**
* Sets the value of the '{@link org.eclipse.oomph.junit.ProblemType#getValue <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param newValue the new value of the '<em>Value</em>' attribute.
* @see #getValue()
* @generated
*/
public void setValue(String newValue)
{
String oldValue = value;
value = newValue;
if (eNotificationRequired())
{
eNotify(new ENotificationImpl(this, Notification.SET, JUnitPackage.PROBLEM_TYPE__VALUE, oldValue, value));
}
}
/**
* Returns the value of the '<em><b>Message</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The error message. e.g., if a java exception is thrown, the return value of getMessage()
* <!-- end-model-doc -->
* @return the value of the '<em>Message</em>' attribute.
* @see #setMessage(String)
* @see org.eclipse.oomph.junit.JUnitPackage#getProblemType_Message()
* @model dataType="org.eclipse.emf.ecore.xml.type.String"
* extendedMetaData="kind='attribute' name='message' namespace='##targetNamespace'"
* @generated
*/
public String getMessage()
{
return message;
}
/**
* Sets the value of the '{@link org.eclipse.oomph.junit.ProblemType#getMessage <em>Message</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param newMessage the new value of the '<em>Message</em>' attribute.
* @see #getMessage()
* @generated
*/
public void setMessage(String newMessage)
{
String oldMessage = message;
message = newMessage;
if (eNotificationRequired())
{
eNotify(new ENotificationImpl(this, Notification.SET, JUnitPackage.PROBLEM_TYPE__MESSAGE, oldMessage, message));
}
}
/**
* Returns the value of the '<em><b>Type</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The type of error that occurred. e.g., if a java exception is thrown the full class name of the exception.
* <!-- end-model-doc -->
* @return the value of the '<em>Type</em>' attribute.
* @see #setType(String)
* @see org.eclipse.oomph.junit.JUnitPackage#getProblemType_Type()
* @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
* extendedMetaData="kind='attribute' name='type' namespace='##targetNamespace'"
* @generated
*/
public String getType()
{
return type;
}
/**
* Sets the value of the '{@link org.eclipse.oomph.junit.ProblemType#getType <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param newType the new value of the '<em>Type</em>' attribute.
* @see #getType()
* @generated
*/
public void setType(String newType)
{
String oldType = type;
type = newType;
if (eNotificationRequired())
{
eNotify(new ENotificationImpl(this, Notification.SET, JUnitPackage.PROBLEM_TYPE__TYPE, oldType, type));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case JUnitPackage.PROBLEM_TYPE__VALUE:
return getValue();
case JUnitPackage.PROBLEM_TYPE__MESSAGE:
return getMessage();
case JUnitPackage.PROBLEM_TYPE__TYPE:
return getType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case JUnitPackage.PROBLEM_TYPE__VALUE:
setValue((String)newValue);
return;
case JUnitPackage.PROBLEM_TYPE__MESSAGE:
setMessage((String)newValue);
return;
case JUnitPackage.PROBLEM_TYPE__TYPE:
setType((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case JUnitPackage.PROBLEM_TYPE__VALUE:
setValue(VALUE_EDEFAULT);
return;
case JUnitPackage.PROBLEM_TYPE__MESSAGE:
setMessage(MESSAGE_EDEFAULT);
return;
case JUnitPackage.PROBLEM_TYPE__TYPE:
setType(TYPE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case JUnitPackage.PROBLEM_TYPE__VALUE:
return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
case JUnitPackage.PROBLEM_TYPE__MESSAGE:
return MESSAGE_EDEFAULT == null ? message != null : !MESSAGE_EDEFAULT.equals(message);
case JUnitPackage.PROBLEM_TYPE__TYPE:
return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString()
{
if (eIsProxy())
{
return super.toString();
}
StringBuilder result = new StringBuilder(super.toString());
result.append(" (value: "); //$NON-NLS-1$
result.append(value);
result.append(", message: "); //$NON-NLS-1$
result.append(message);
result.append(", type: "); //$NON-NLS-1$
result.append(type);
result.append(')');
return result.toString();
}
} // ProblemType