org.eclipse.basyx.submodel.restapi.MultiSubmodelElementProvider Maven / Gradle / Ivy
/*******************************************************************************
* Copyright (C) 2021 the Eclipse BaSyx Authors
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
******************************************************************************/
package org.eclipse.basyx.submodel.restapi;
import java.util.Collection;
import java.util.Map;
import java.util.stream.Collectors;
import org.eclipse.basyx.submodel.metamodel.facade.SubmodelElementMapCollectionConverter;
import org.eclipse.basyx.submodel.metamodel.map.submodelelement.SubmodelElementCollection;
import org.eclipse.basyx.vab.exception.provider.MalformedRequestException;
import org.eclipse.basyx.vab.exception.provider.ProviderException;
import org.eclipse.basyx.vab.exception.provider.ResourceNotFoundException;
import org.eclipse.basyx.vab.modelprovider.VABElementProxy;
import org.eclipse.basyx.vab.modelprovider.VABPathTools;
import org.eclipse.basyx.vab.modelprovider.api.IModelProvider;
/**
* Provider that handles container properties. Container properties can contain other submodel elements.
*
* @author espen, conradi
*
*/
public class MultiSubmodelElementProvider implements IModelProvider {
// Constants for API-Access
public static final String ELEMENTS = "submodelElements";
public static final String VALUE = "value";
// The VAB model provider containing the submodelElements this SubmodelElementProvider is based on
// Assumed to be a map that maps idShorts to the submodel elements
private IModelProvider modelProvider;
/**
* Constructor based on a model provider that contains the container property
*/
public MultiSubmodelElementProvider(IModelProvider provider) {
this.modelProvider = provider;
}
/**
* The elements are stored in a map => convert them to a list
*/
@SuppressWarnings("unchecked")
protected Collection
© 2015 - 2025 Weber Informatics LLC | Privacy Policy