blob: cda51ab18ce5845df216986b68823afa24bf491b [file] [log] [blame]
/**
* Copyright (c) 2018 CEA
*
* 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:
* Jérémie Tatibouet (CEA) jeremie.tatibouet@cea.fr - Initial API and implementation
* Benoit Maggi (CEA) benoit.maggi@cea.fr - Initial API and implementation
* Shuai Li (CEA) shuai.li@cea.fr - Integration of sensiNact and Web of Things Thing Description
*
*/
package org.eclipse.papyrus.iotml.wot.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
import org.eclipse.papyrus.iotml.wot.AuthorizationFlowKind;
import org.eclipse.papyrus.iotml.wot.QoPKind;
import org.eclipse.papyrus.iotml.wot.SecurityAlgorithmKind;
import org.eclipse.papyrus.iotml.wot.SecurityAuthenticationFormatKind;
import org.eclipse.papyrus.iotml.wot.SecurityAuthenticationInformationLocationKind;
import org.eclipse.papyrus.iotml.wot.SecurityScheme;
import org.eclipse.papyrus.iotml.wot.SecuritySchemeKind;
import org.eclipse.papyrus.iotml.wot.WoTPackage;
import org.eclipse.uml2.uml.Classifier;
import org.eclipse.uml2.uml.Comment;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.NamedElement;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Security Scheme</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getBase_Classifier <em>Base Classifier</em>}</li>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getTitle <em>Title</em>}</li>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getDescription <em>Description</em>}</li>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getScheme <em>Scheme</em>}</li>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getProxy <em>Proxy</em>}</li>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getIn <em>In</em>}</li>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getQop <em>Qop</em>}</li>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getAuthorization <em>Authorization</em>}</li>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getAlg <em>Alg</em>}</li>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getFormat <em>Format</em>}</li>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getIdentity <em>Identity</em>}</li>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getToken <em>Token</em>}</li>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getRefresh <em>Refresh</em>}</li>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getScopes <em>Scopes</em>}</li>
* <li>{@link org.eclipse.papyrus.iotml.wot.impl.SecuritySchemeImpl#getFlow <em>Flow</em>}</li>
* </ul>
*
* @generated
*/
@JsonPropertyOrder({"@type", "title", "description", "scheme", "proxy", "in", "qop", "name", "authorization", "alg", "format", "identity", "token", "refresh", "scopes", "flow"})
public class SecuritySchemeImpl extends MinimalEObjectImpl.Container implements SecurityScheme {
/**
* The cached value of the '{@link #getBase_Classifier() <em>Base Classifier</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBase_Classifier()
* @generated
* @ordered
*/
protected Classifier base_Classifier;
/**
* The default value of the '{@link #getTitle() <em>Title</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTitle()
* @generated
* @ordered
*/
protected static final String TITLE_EDEFAULT = null;
/**
* The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected static final String DESCRIPTION_EDEFAULT = null;
/**
* The default value of the '{@link #getScheme() <em>Scheme</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getScheme()
* @generated
* @ordered
*/
protected static final SecuritySchemeKind SCHEME_EDEFAULT = SecuritySchemeKind.NOSEC;
/**
* The cached value of the '{@link #getScheme() <em>Scheme</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getScheme()
* @generated
* @ordered
*/
protected SecuritySchemeKind scheme = SCHEME_EDEFAULT;
/**
* The default value of the '{@link #getProxy() <em>Proxy</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProxy()
* @generated
* @ordered
*/
protected static final String PROXY_EDEFAULT = null;
/**
* The cached value of the '{@link #getProxy() <em>Proxy</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProxy()
* @generated
* @ordered
*/
protected String proxy = PROXY_EDEFAULT;
/**
* The default value of the '{@link #getIn() <em>In</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIn()
* @generated
* @ordered
*/
protected static final SecurityAuthenticationInformationLocationKind IN_EDEFAULT = SecurityAuthenticationInformationLocationKind.HEADER;
/**
* The cached value of the '{@link #getIn() <em>In</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIn()
* @generated
* @ordered
*/
protected SecurityAuthenticationInformationLocationKind in = IN_EDEFAULT;
/**
* The default value of the '{@link #getQop() <em>Qop</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getQop()
* @generated
* @ordered
*/
protected static final QoPKind QOP_EDEFAULT = QoPKind.AUTH;
/**
* The cached value of the '{@link #getQop() <em>Qop</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getQop()
* @generated
* @ordered
*/
protected QoPKind qop = QOP_EDEFAULT;
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #getAuthorization() <em>Authorization</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAuthorization()
* @generated
* @ordered
*/
protected static final String AUTHORIZATION_EDEFAULT = null;
/**
* The cached value of the '{@link #getAuthorization() <em>Authorization</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAuthorization()
* @generated
* @ordered
*/
protected String authorization = AUTHORIZATION_EDEFAULT;
/**
* The default value of the '{@link #getAlg() <em>Alg</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAlg()
* @generated
* @ordered
*/
protected static final SecurityAlgorithmKind ALG_EDEFAULT = SecurityAlgorithmKind.MD5;
/**
* The cached value of the '{@link #getAlg() <em>Alg</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAlg()
* @generated
* @ordered
*/
protected SecurityAlgorithmKind alg = ALG_EDEFAULT;
/**
* The default value of the '{@link #getFormat() <em>Format</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFormat()
* @generated
* @ordered
*/
protected static final SecurityAuthenticationFormatKind FORMAT_EDEFAULT = SecurityAuthenticationFormatKind.JWT;
/**
* The cached value of the '{@link #getFormat() <em>Format</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFormat()
* @generated
* @ordered
*/
protected SecurityAuthenticationFormatKind format = FORMAT_EDEFAULT;
/**
* The default value of the '{@link #getIdentity() <em>Identity</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIdentity()
* @generated
* @ordered
*/
protected static final String IDENTITY_EDEFAULT = null;
/**
* The cached value of the '{@link #getIdentity() <em>Identity</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIdentity()
* @generated
* @ordered
*/
protected String identity = IDENTITY_EDEFAULT;
/**
* The default value of the '{@link #getToken() <em>Token</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getToken()
* @generated
* @ordered
*/
protected static final String TOKEN_EDEFAULT = null;
/**
* The cached value of the '{@link #getToken() <em>Token</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getToken()
* @generated
* @ordered
*/
protected String token = TOKEN_EDEFAULT;
/**
* The default value of the '{@link #getRefresh() <em>Refresh</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRefresh()
* @generated
* @ordered
*/
protected static final String REFRESH_EDEFAULT = null;
/**
* The cached value of the '{@link #getRefresh() <em>Refresh</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRefresh()
* @generated
* @ordered
*/
protected String refresh = REFRESH_EDEFAULT;
/**
* The cached value of the '{@link #getScopes() <em>Scopes</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getScopes()
* @generated
* @ordered
*/
protected EList<String> scopes;
/**
* The default value of the '{@link #getFlow() <em>Flow</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFlow()
* @generated
* @ordered
*/
protected static final AuthorizationFlowKind FLOW_EDEFAULT = AuthorizationFlowKind.IMPLICIT;
/**
* The cached value of the '{@link #getFlow() <em>Flow</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFlow()
* @generated
* @ordered
*/
protected AuthorizationFlowKind flow = FLOW_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SecuritySchemeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return WoTPackage.Literals.SECURITY_SCHEME;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public Classifier getBase_Classifier() {
if (base_Classifier != null && base_Classifier.eIsProxy()) {
InternalEObject oldBase_Classifier = (InternalEObject)base_Classifier;
base_Classifier = (Classifier)eResolveProxy(oldBase_Classifier);
if (base_Classifier != oldBase_Classifier) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WoTPackage.SECURITY_SCHEME__BASE_CLASSIFIER, oldBase_Classifier, base_Classifier));
}
}
return base_Classifier;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Classifier basicGetBase_Classifier() {
return base_Classifier;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public void setBase_Classifier(Classifier newBase_Classifier) {
Classifier oldBase_Classifier = base_Classifier;
base_Classifier = newBase_Classifier;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WoTPackage.SECURITY_SCHEME__BASE_CLASSIFIER, oldBase_Classifier, base_Classifier));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
@JsonGetter("title")
public String getTitle() {
NamedElement namedElement = this.getBase_Classifier();
if (namedElement != null) {
return namedElement.getName();
}
return "";
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public void setTitle(String newTitle) {
// TODO: implement this method to set the 'Title' attribute
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
@JsonGetter("description")
public String getDescription() {
Element element = this.getBase_Classifier();
if (element != null) {
for (Comment comment : element.getOwnedComments()) {
if (!comment.getBody().isEmpty()) {
return comment.getBody();
}
}
}
return "";
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public void setDescription(String newDescription) {
// TODO: implement this method to set the 'Description' attribute
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonGetter("scheme")
public SecuritySchemeKind getScheme() {
return scheme;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public void setScheme(SecuritySchemeKind newScheme) {
SecuritySchemeKind oldScheme = scheme;
scheme = newScheme == null ? SCHEME_EDEFAULT : newScheme;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WoTPackage.SECURITY_SCHEME__SCHEME, oldScheme, scheme));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonGetter("proxy")
public String getProxy() {
return proxy;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public void setProxy(String newProxy) {
String oldProxy = proxy;
proxy = newProxy;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WoTPackage.SECURITY_SCHEME__PROXY, oldProxy, proxy));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonGetter("in")
public SecurityAuthenticationInformationLocationKind getIn() {
return in;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public void setIn(SecurityAuthenticationInformationLocationKind newIn) {
SecurityAuthenticationInformationLocationKind oldIn = in;
in = newIn == null ? IN_EDEFAULT : newIn;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WoTPackage.SECURITY_SCHEME__IN, oldIn, in));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonGetter("qop")
public QoPKind getQop() {
return qop;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public void setQop(QoPKind newQop) {
QoPKind oldQop = qop;
qop = newQop == null ? QOP_EDEFAULT : newQop;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WoTPackage.SECURITY_SCHEME__QOP, oldQop, qop));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonGetter("name")
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WoTPackage.SECURITY_SCHEME__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonGetter("authorization")
public String getAuthorization() {
return authorization;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public void setAuthorization(String newAuthorization) {
String oldAuthorization = authorization;
authorization = newAuthorization;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WoTPackage.SECURITY_SCHEME__AUTHORIZATION, oldAuthorization, authorization));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonGetter("alg")
public SecurityAlgorithmKind getAlg() {
return alg;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public void setAlg(SecurityAlgorithmKind newAlg) {
SecurityAlgorithmKind oldAlg = alg;
alg = newAlg == null ? ALG_EDEFAULT : newAlg;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WoTPackage.SECURITY_SCHEME__ALG, oldAlg, alg));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonGetter("format")
public SecurityAuthenticationFormatKind getFormat() {
return format;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public void setFormat(SecurityAuthenticationFormatKind newFormat) {
SecurityAuthenticationFormatKind oldFormat = format;
format = newFormat == null ? FORMAT_EDEFAULT : newFormat;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WoTPackage.SECURITY_SCHEME__FORMAT, oldFormat, format));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonGetter("identity")
public String getIdentity() {
return identity;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public void setIdentity(String newIdentity) {
String oldIdentity = identity;
identity = newIdentity;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WoTPackage.SECURITY_SCHEME__IDENTITY, oldIdentity, identity));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonGetter("token")
public String getToken() {
return token;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public void setToken(String newToken) {
String oldToken = token;
token = newToken;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WoTPackage.SECURITY_SCHEME__TOKEN, oldToken, token));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonGetter("refresh")
public String getRefresh() {
return refresh;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public void setRefresh(String newRefresh) {
String oldRefresh = refresh;
refresh = newRefresh;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WoTPackage.SECURITY_SCHEME__REFRESH, oldRefresh, refresh));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonGetter("scopes")
public EList<String> getScopes() {
if (scopes == null) {
scopes = new EDataTypeUniqueEList<String>(String.class, this, WoTPackage.SECURITY_SCHEME__SCOPES);
}
return scopes;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonGetter("flow")
public AuthorizationFlowKind getFlow() {
return flow;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@JsonIgnore
public void setFlow(AuthorizationFlowKind newFlow) {
AuthorizationFlowKind oldFlow = flow;
flow = newFlow == null ? FLOW_EDEFAULT : newFlow;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WoTPackage.SECURITY_SCHEME__FLOW, oldFlow, flow));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case WoTPackage.SECURITY_SCHEME__BASE_CLASSIFIER:
if (resolve) return getBase_Classifier();
return basicGetBase_Classifier();
case WoTPackage.SECURITY_SCHEME__TITLE:
return getTitle();
case WoTPackage.SECURITY_SCHEME__DESCRIPTION:
return getDescription();
case WoTPackage.SECURITY_SCHEME__SCHEME:
return getScheme();
case WoTPackage.SECURITY_SCHEME__PROXY:
return getProxy();
case WoTPackage.SECURITY_SCHEME__IN:
return getIn();
case WoTPackage.SECURITY_SCHEME__QOP:
return getQop();
case WoTPackage.SECURITY_SCHEME__NAME:
return getName();
case WoTPackage.SECURITY_SCHEME__AUTHORIZATION:
return getAuthorization();
case WoTPackage.SECURITY_SCHEME__ALG:
return getAlg();
case WoTPackage.SECURITY_SCHEME__FORMAT:
return getFormat();
case WoTPackage.SECURITY_SCHEME__IDENTITY:
return getIdentity();
case WoTPackage.SECURITY_SCHEME__TOKEN:
return getToken();
case WoTPackage.SECURITY_SCHEME__REFRESH:
return getRefresh();
case WoTPackage.SECURITY_SCHEME__SCOPES:
return getScopes();
case WoTPackage.SECURITY_SCHEME__FLOW:
return getFlow();
}
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 WoTPackage.SECURITY_SCHEME__BASE_CLASSIFIER:
setBase_Classifier((Classifier)newValue);
return;
case WoTPackage.SECURITY_SCHEME__TITLE:
setTitle((String)newValue);
return;
case WoTPackage.SECURITY_SCHEME__DESCRIPTION:
setDescription((String)newValue);
return;
case WoTPackage.SECURITY_SCHEME__SCHEME:
setScheme((SecuritySchemeKind)newValue);
return;
case WoTPackage.SECURITY_SCHEME__PROXY:
setProxy((String)newValue);
return;
case WoTPackage.SECURITY_SCHEME__IN:
setIn((SecurityAuthenticationInformationLocationKind)newValue);
return;
case WoTPackage.SECURITY_SCHEME__QOP:
setQop((QoPKind)newValue);
return;
case WoTPackage.SECURITY_SCHEME__NAME:
setName((String)newValue);
return;
case WoTPackage.SECURITY_SCHEME__AUTHORIZATION:
setAuthorization((String)newValue);
return;
case WoTPackage.SECURITY_SCHEME__ALG:
setAlg((SecurityAlgorithmKind)newValue);
return;
case WoTPackage.SECURITY_SCHEME__FORMAT:
setFormat((SecurityAuthenticationFormatKind)newValue);
return;
case WoTPackage.SECURITY_SCHEME__IDENTITY:
setIdentity((String)newValue);
return;
case WoTPackage.SECURITY_SCHEME__TOKEN:
setToken((String)newValue);
return;
case WoTPackage.SECURITY_SCHEME__REFRESH:
setRefresh((String)newValue);
return;
case WoTPackage.SECURITY_SCHEME__SCOPES:
getScopes().clear();
getScopes().addAll((Collection<? extends String>)newValue);
return;
case WoTPackage.SECURITY_SCHEME__FLOW:
setFlow((AuthorizationFlowKind)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case WoTPackage.SECURITY_SCHEME__BASE_CLASSIFIER:
setBase_Classifier((Classifier)null);
return;
case WoTPackage.SECURITY_SCHEME__TITLE:
setTitle(TITLE_EDEFAULT);
return;
case WoTPackage.SECURITY_SCHEME__DESCRIPTION:
setDescription(DESCRIPTION_EDEFAULT);
return;
case WoTPackage.SECURITY_SCHEME__SCHEME:
setScheme(SCHEME_EDEFAULT);
return;
case WoTPackage.SECURITY_SCHEME__PROXY:
setProxy(PROXY_EDEFAULT);
return;
case WoTPackage.SECURITY_SCHEME__IN:
setIn(IN_EDEFAULT);
return;
case WoTPackage.SECURITY_SCHEME__QOP:
setQop(QOP_EDEFAULT);
return;
case WoTPackage.SECURITY_SCHEME__NAME:
setName(NAME_EDEFAULT);
return;
case WoTPackage.SECURITY_SCHEME__AUTHORIZATION:
setAuthorization(AUTHORIZATION_EDEFAULT);
return;
case WoTPackage.SECURITY_SCHEME__ALG:
setAlg(ALG_EDEFAULT);
return;
case WoTPackage.SECURITY_SCHEME__FORMAT:
setFormat(FORMAT_EDEFAULT);
return;
case WoTPackage.SECURITY_SCHEME__IDENTITY:
setIdentity(IDENTITY_EDEFAULT);
return;
case WoTPackage.SECURITY_SCHEME__TOKEN:
setToken(TOKEN_EDEFAULT);
return;
case WoTPackage.SECURITY_SCHEME__REFRESH:
setRefresh(REFRESH_EDEFAULT);
return;
case WoTPackage.SECURITY_SCHEME__SCOPES:
getScopes().clear();
return;
case WoTPackage.SECURITY_SCHEME__FLOW:
setFlow(FLOW_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case WoTPackage.SECURITY_SCHEME__BASE_CLASSIFIER:
return base_Classifier != null;
case WoTPackage.SECURITY_SCHEME__TITLE:
return TITLE_EDEFAULT == null ? getTitle() != null : !TITLE_EDEFAULT.equals(getTitle());
case WoTPackage.SECURITY_SCHEME__DESCRIPTION:
return DESCRIPTION_EDEFAULT == null ? getDescription() != null : !DESCRIPTION_EDEFAULT.equals(getDescription());
case WoTPackage.SECURITY_SCHEME__SCHEME:
return scheme != SCHEME_EDEFAULT;
case WoTPackage.SECURITY_SCHEME__PROXY:
return PROXY_EDEFAULT == null ? proxy != null : !PROXY_EDEFAULT.equals(proxy);
case WoTPackage.SECURITY_SCHEME__IN:
return in != IN_EDEFAULT;
case WoTPackage.SECURITY_SCHEME__QOP:
return qop != QOP_EDEFAULT;
case WoTPackage.SECURITY_SCHEME__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case WoTPackage.SECURITY_SCHEME__AUTHORIZATION:
return AUTHORIZATION_EDEFAULT == null ? authorization != null : !AUTHORIZATION_EDEFAULT.equals(authorization);
case WoTPackage.SECURITY_SCHEME__ALG:
return alg != ALG_EDEFAULT;
case WoTPackage.SECURITY_SCHEME__FORMAT:
return format != FORMAT_EDEFAULT;
case WoTPackage.SECURITY_SCHEME__IDENTITY:
return IDENTITY_EDEFAULT == null ? identity != null : !IDENTITY_EDEFAULT.equals(identity);
case WoTPackage.SECURITY_SCHEME__TOKEN:
return TOKEN_EDEFAULT == null ? token != null : !TOKEN_EDEFAULT.equals(token);
case WoTPackage.SECURITY_SCHEME__REFRESH:
return REFRESH_EDEFAULT == null ? refresh != null : !REFRESH_EDEFAULT.equals(refresh);
case WoTPackage.SECURITY_SCHEME__SCOPES:
return scopes != null && !scopes.isEmpty();
case WoTPackage.SECURITY_SCHEME__FLOW:
return flow != FLOW_EDEFAULT;
}
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(" (scheme: ");
result.append(scheme);
result.append(", proxy: ");
result.append(proxy);
result.append(", in: ");
result.append(in);
result.append(", qop: ");
result.append(qop);
result.append(", name: ");
result.append(name);
result.append(", authorization: ");
result.append(authorization);
result.append(", alg: ");
result.append(alg);
result.append(", format: ");
result.append(format);
result.append(", identity: ");
result.append(identity);
result.append(", token: ");
result.append(token);
result.append(", refresh: ");
result.append(refresh);
result.append(", scopes: ");
result.append(scopes);
result.append(", flow: ");
result.append(flow);
result.append(')');
return result.toString();
}
} //SecuritySchemeImpl