blob: b81d37c5367126abb51b86444a778608c8ad9954 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2020 RBEI and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v. 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Abirami Bhologa Indiran - Initial contribution and API
*******************************************************************************/
package org.eclipse.blockchain.core;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.blockchain.core.interfaces.IBlockchainView;
/**
* A registry which holds a list of views that implement IBlockchainView
*/
public class BlockchainViewsRegistry {
private static Set<IBlockchainView> listOFViews = new HashSet<>();
private BlockchainViewsRegistry() {
}
/**
* @param view
* - The view that extends IBlockchainView
*/
public static void registerBlockchainView(final IBlockchainView view) {
listOFViews.add(view);
}
/**
* @param view
* - The view that extends IBlockchainView
*/
public static void dereisterBlockchainView(final IBlockchainView view) {
listOFViews.remove(view);
}
/**
* @return the listOFViews
*/
public static Set<IBlockchainView> getListOFViews() {
return listOFViews;
}
}