/*-
* ============LICENSE_START==========================================
* OPENECOMP - DCAE
* ===================================================================
* Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
* 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.
* ============LICENSE_END============================================
*/
/**
*/
package org.openecomp.ncomp.openstack.ceilometer.impl;
import org.openecomp.ncomp.openstack.ceilometer.CeilometerOrderedBy;
import org.openecomp.ncomp.openstack.ceilometer.CeilometerPackage;
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;
/**
*
* An implementation of the model object 'Ordered By'.
*
*
* The following features are implemented:
*
*
* - {@link org.openecomp.ncomp.openstack.ceilometer.impl.CeilometerOrderedByImpl#getField Field}
* - {@link org.openecomp.ncomp.openstack.ceilometer.impl.CeilometerOrderedByImpl#getDirection Direction}
*
*
* @generated
*/
public class CeilometerOrderedByImpl extends MinimalEObjectImpl.Container implements CeilometerOrderedBy {
/**
* The default value of the '{@link #getField() Field}' attribute.
*
*
* @see #getField()
* @generated
* @ordered
*/
protected static final String FIELD_EDEFAULT = null;
/**
* The cached value of the '{@link #getField() Field}' attribute.
*
*
* @see #getField()
* @generated
* @ordered
*/
protected String field = FIELD_EDEFAULT;
/**
* The default value of the '{@link #getDirection() Direction}' attribute.
*
*
* @see #getDirection()
* @generated
* @ordered
*/
protected static final String DIRECTION_EDEFAULT = null;
/**
* The cached value of the '{@link #getDirection() Direction}' attribute.
*
*
* @see #getDirection()
* @generated
* @ordered
*/
protected String direction = DIRECTION_EDEFAULT;
/**
*
*
* @generated
*/
protected CeilometerOrderedByImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return CeilometerPackage.Literals.CEILOMETER_ORDERED_BY;
}
/**
*
*
* @generated
*/
public String getField() {
return field;
}
/**
*
*
* @generated
*/
public void setField(String newField) {
String oldField = field;
field = newField;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CeilometerPackage.CEILOMETER_ORDERED_BY__FIELD, oldField, field));
}
/**
*
*
* @generated
*/
public String getDirection() {
return direction;
}
/**
*
*
* @generated
*/
public void setDirection(String newDirection) {
String oldDirection = direction;
direction = newDirection;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CeilometerPackage.CEILOMETER_ORDERED_BY__DIRECTION, oldDirection, direction));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CeilometerPackage.CEILOMETER_ORDERED_BY__FIELD:
return getField();
case CeilometerPackage.CEILOMETER_ORDERED_BY__DIRECTION:
return getDirection();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CeilometerPackage.CEILOMETER_ORDERED_BY__FIELD:
setField((String)newValue);
return;
case CeilometerPackage.CEILOMETER_ORDERED_BY__DIRECTION:
setDirection((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CeilometerPackage.CEILOMETER_ORDERED_BY__FIELD:
setField(FIELD_EDEFAULT);
return;
case CeilometerPackage.CEILOMETER_ORDERED_BY__DIRECTION:
setDirection(DIRECTION_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CeilometerPackage.CEILOMETER_ORDERED_BY__FIELD:
return FIELD_EDEFAULT == null ? field != null : !FIELD_EDEFAULT.equals(field);
case CeilometerPackage.CEILOMETER_ORDERED_BY__DIRECTION:
return DIRECTION_EDEFAULT == null ? direction != null : !DIRECTION_EDEFAULT.equals(direction);
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (field: ");
result.append(field);
result.append(", direction: ");
result.append(direction);
result.append(')');
return result.toString();
}
} //CeilometerOrderedByImpl