blob: 115a5b2d9919f68049f0a9b23e6ca4773b8baefe [file] [log] [blame]
/**
********************************************************************************
* Copyright (c) 2018-2019 Robert Bosch GmbH.
*
* 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
*
* Contributors:
* Robert Bosch GmbH - initial API and implementation
********************************************************************************
*/
package org.eclipse.app4mc.transformation.extensions
import java.util.HashMap
class CustomObjectsStore {
private var cls_instance_map = new HashMap();
private var data_map = new HashMap<String, Object>();
public def <T> T getInstance(Object cls) {
val value = cls_instance_map.get(cls);
return value as T
}
public def <T> void injectMembers(Object cls, T instance) {
cls_instance_map.put(cls, instance);
}
public def <T> void indexData(String key, T value){
data_map.put(key, value);
}
public def <T> getData(String key){
data_map.get(key) as T
}
public def void clearCache() {
cls_instance_map.clear
}
}