| /******************************************************************************* |
| * Copyright (c) 2016 David Carlson and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * David Carlson (Clinical Cloud Solutions, LLC) - initial API and implementation |
| *******************************************************************************/ |
| /** |
| */ |
| package org.eclipse.mdht.uml.fhir.core.resource.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.mdht.uml.fhir.core.datatype.Base64Binary; |
| import org.eclipse.mdht.uml.fhir.core.datatype.Code; |
| |
| import org.eclipse.mdht.uml.fhir.core.resource.Binary; |
| import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Binary</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.BinaryImpl#getContentType <em>Content Type</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.BinaryImpl#getContent <em>Content</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class BinaryImpl extends ResourceImpl implements Binary { |
| /** |
| * The cached value of the '{@link #getContentType() <em>Content Type</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getContentType() |
| * @generated |
| * @ordered |
| */ |
| protected Code contentType; |
| |
| /** |
| * The cached value of the '{@link #getContent() <em>Content</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getContent() |
| * @generated |
| * @ordered |
| */ |
| protected Base64Binary content; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected BinaryImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirResourcePackage.eINSTANCE.getBinary(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code getContentType() { |
| if (contentType != null && contentType.eIsProxy()) { |
| InternalEObject oldContentType = (InternalEObject)contentType; |
| contentType = (Code)eResolveProxy(oldContentType); |
| if (contentType != oldContentType) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.BINARY__CONTENT_TYPE, oldContentType, contentType)); |
| } |
| } |
| return contentType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code basicGetContentType() { |
| return contentType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setContentType(Code newContentType) { |
| Code oldContentType = contentType; |
| contentType = newContentType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.BINARY__CONTENT_TYPE, oldContentType, contentType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Base64Binary getContent() { |
| if (content != null && content.eIsProxy()) { |
| InternalEObject oldContent = (InternalEObject)content; |
| content = (Base64Binary)eResolveProxy(oldContent); |
| if (content != oldContent) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.BINARY__CONTENT, oldContent, content)); |
| } |
| } |
| return content; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Base64Binary basicGetContent() { |
| return content; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setContent(Base64Binary newContent) { |
| Base64Binary oldContent = content; |
| content = newContent; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.BINARY__CONTENT, oldContent, content)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FhirResourcePackage.BINARY__CONTENT_TYPE: |
| if (resolve) return getContentType(); |
| return basicGetContentType(); |
| case FhirResourcePackage.BINARY__CONTENT: |
| if (resolve) return getContent(); |
| return basicGetContent(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case FhirResourcePackage.BINARY__CONTENT_TYPE: |
| setContentType((Code)newValue); |
| return; |
| case FhirResourcePackage.BINARY__CONTENT: |
| setContent((Base64Binary)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.BINARY__CONTENT_TYPE: |
| setContentType((Code)null); |
| return; |
| case FhirResourcePackage.BINARY__CONTENT: |
| setContent((Base64Binary)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.BINARY__CONTENT_TYPE: |
| return contentType != null; |
| case FhirResourcePackage.BINARY__CONTENT: |
| return content != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //BinaryImpl |