From 8932d1a96ce501220f816234fafc6bce64cb2ea3 Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Wed, 11 Oct 2023 09:38:28 +0200 Subject: [PATCH] remove protocolinformation --- .../aas4j/v3/model/ProtocolInformation.java | 134 ------------- .../builder/ProtocolInformationBuilder.java | 102 ---------- .../impl/DefaultProtocolInformation.java | 181 ------------------ 3 files changed, 417 deletions(-) delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java deleted file mode 100644 index d74f39fa9..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * 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. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProtocolInformation; - -import java.util.List; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultProtocolInformation.class) -}) -public interface ProtocolInformation { - - /** - * - * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/href - * - * @return Returns the String for the property href. - */ - @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/href") - String getHref(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/href - * - * @param href desired value for the property href. - */ - void setHref(String href); - - /** - * - * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocol - * - * @return Returns the String for the property endpointProtocol. - */ - @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocol") - String getEndpointProtocol(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocol - * - * @param endpointProtocol desired value for the property endpointProtocol. - */ - void setEndpointProtocol(String endpointProtocol); - - /** - * - * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocolVersion - * - * @return Returns the List of Strings for the property endpointProtocolVersion. - */ - @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocolVersion") - List getEndpointProtocolVersion(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocolVersion - * - * @param endpointProtocolVersions desired value for the property endpointProtocolVersion. - */ - void setEndpointProtocolVersion(List endpointProtocolVersions); - - /** - * - * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocol - * - * @return Returns the String for the property subprotocol. - */ - @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocol") - String getSubprotocol(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocol - * - * @param subprotocol desired value for the property subprotocol. - */ - void setSubprotocol(String subprotocol); - - /** - * - * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBody - * - * @return Returns the String for the property subprotocolBody. - */ - @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBody") - String getSubprotocolBody(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBody - * - * @param subprotocolBody desired value for the property subprotocolBody. - */ - void setSubprotocolBody(String subprotocolBody); - - /** - * - * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBodyEncoding - * - * @return Returns the String for the property subprotocolBodyEncoding. - */ - @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBodyEncoding") - String getSubprotocolBodyEncoding(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBodyEncoding - * - * @param subprotocolBodyEncoding desired value for the property subprotocolBodyEncoding. - */ - void setSubprotocolBodyEncoding(String subprotocolBodyEncoding); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java deleted file mode 100644 index d6b602017..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * 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. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; - -import java.util.List; - - -public abstract class ProtocolInformationBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for href - * - * @param href desired value to be set - * @return Builder object with new value for href - */ - public B href(String href) { - getBuildingInstance().setHref(href); - return getSelf(); - } - - /** - * This function allows setting a value for endpointProtocol - * - * @param endpointProtocol desired value to be set - * @return Builder object with new value for endpointProtocol - */ - public B endpointProtocol(String endpointProtocol) { - getBuildingInstance().setEndpointProtocol(endpointProtocol); - return getSelf(); - } - - /** - * This function allows setting a value for endpointProtocolVersion - * - * @param endpointProtocolVersions desired value to be set - * @return Builder object with new value for endpointProtocolVersion - */ - public B endpointProtocolVersion(List endpointProtocolVersions) { - getBuildingInstance().setEndpointProtocolVersion(endpointProtocolVersions); - return getSelf(); - } - - /** - * This function allows adding a value to the List endpointProtocolVersion - * - * @param endpointProtocolVersion desired value to be added - * @return Builder object with new value for endpointProtocolVersion - */ - public B endpointProtocolVersion(String endpointProtocolVersion) { - getBuildingInstance().getEndpointProtocolVersion().add(endpointProtocolVersion); - return getSelf(); - } - - /** - * This function allows setting a value for subprotocol - * - * @param subprotocol desired value to be set - * @return Builder object with new value for subprotocol - */ - public B subprotocol(String subprotocol) { - getBuildingInstance().setSubprotocol(subprotocol); - return getSelf(); - } - - /** - * This function allows setting a value for subprotocolBody - * - * @param subprotocolBody desired value to be set - * @return Builder object with new value for subprotocolBody - */ - public B subprotocolBody(String subprotocolBody) { - getBuildingInstance().setSubprotocolBody(subprotocolBody); - return getSelf(); - } - - /** - * This function allows setting a value for subprotocolBodyEncoding - * - * @param subprotocolBodyEncoding desired value to be set - * @return Builder object with new value for subprotocolBodyEncoding - */ - public B subprotocolBodyEncoding(String subprotocolBodyEncoding) { - getBuildingInstance().setSubprotocolBodyEncoding(subprotocolBodyEncoding); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java deleted file mode 100644 index 277fd3235..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * 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. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.ProtocolInformationBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation - * - */ - -@IRI("aas:ProtocolInformation") -public class DefaultProtocolInformation implements ProtocolInformation { - - @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocol") - protected String endpointProtocol; - - @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocolVersion") - protected List endpointProtocolVersion = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/href") - protected String href; - - @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocol") - protected String subprotocol; - - @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBody") - protected String subprotocolBody; - - @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBodyEncoding") - protected String subprotocolBodyEncoding; - - public DefaultProtocolInformation() {} - - public DefaultProtocolInformation(ProtocolInformation x) { - this.endpointProtocol = x.getEndpointProtocol(); - this.endpointProtocolVersion = x.getEndpointProtocolVersion(); - this.href = x.getHref(); - this.subprotocol = x.getSubprotocol(); - this.subprotocolBody = x.getSubprotocolBody(); - this.subprotocolBodyEncoding = x.getSubprotocolBodyEncoding(); - } - - @Override - public int hashCode() { - return Objects.hash(this.href, - this.endpointProtocol, - this.endpointProtocolVersion, - this.subprotocol, - this.subprotocolBody, - this.subprotocolBodyEncoding); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultProtocolInformation other = (DefaultProtocolInformation) obj; - return Objects.equals(this.href, other.href) && - Objects.equals(this.endpointProtocol, other.endpointProtocol) && - Objects.equals(this.endpointProtocolVersion, other.endpointProtocolVersion) && - Objects.equals(this.subprotocol, other.subprotocol) && - Objects.equals(this.subprotocolBody, other.subprotocolBody) && - Objects.equals(this.subprotocolBodyEncoding, other.subprotocolBodyEncoding); - } - } - - @Override - public String getHref() { - return href; - } - - @Override - public void setHref(String href) { - this.href = href; - } - - @Override - public String getEndpointProtocol() { - return endpointProtocol; - } - - @Override - public void setEndpointProtocol(String endpointProtocol) { - this.endpointProtocol = endpointProtocol; - } - - @Override - public List getEndpointProtocolVersion() { - return endpointProtocolVersion; - } - - @Override - public void setEndpointProtocolVersion(List endpointProtocolVersions) { - this.endpointProtocolVersion = endpointProtocolVersions; - } - - @Override - public String getSubprotocol() { - return subprotocol; - } - - @Override - public void setSubprotocol(String subprotocol) { - this.subprotocol = subprotocol; - } - - @Override - public String getSubprotocolBody() { - return subprotocolBody; - } - - @Override - public void setSubprotocolBody(String subprotocolBody) { - this.subprotocolBody = subprotocolBody; - } - - @Override - public String getSubprotocolBodyEncoding() { - return subprotocolBodyEncoding; - } - - @Override - public void setSubprotocolBodyEncoding(String subprotocolBodyEncoding) { - this.subprotocolBodyEncoding = subprotocolBodyEncoding; - } - - public String toString() { - return String.format( - "DefaultProtocolInformation (" + "href=%s," - + "endpointProtocol=%s," - + "endpointProtocolVersion=%s," - + "subprotocol=%s," - + "subprotocolBody=%s," - + "subprotocolBodyEncoding=%s," - + ")", - this.href, this.endpointProtocol, this.endpointProtocolVersion, this.subprotocol, this.subprotocolBody, - this.subprotocolBodyEncoding); - } - - /** - * This builder class can be used to construct a DefaultProtocolInformation bean. - */ - public static class Builder extends ProtocolInformationBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultProtocolInformation newBuildingInstance() { - return new DefaultProtocolInformation(); - } - } -}