From f3814a84f8471684cd483347db4fb7b107c2e635 Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Thu, 3 Dec 2020 19:28:15 -0500 Subject: Rename interfaces to match Java style Rename several interfaces that were in the style IWhatever, which Java doesn't use --- .../bjc/utils/components/ComponentRepository.java | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 base/src/main/java/bjc/utils/components/ComponentRepository.java (limited to 'base/src/main/java/bjc/utils/components/ComponentRepository.java') diff --git a/base/src/main/java/bjc/utils/components/ComponentRepository.java b/base/src/main/java/bjc/utils/components/ComponentRepository.java new file mode 100644 index 0000000..120edc8 --- /dev/null +++ b/base/src/main/java/bjc/utils/components/ComponentRepository.java @@ -0,0 +1,49 @@ +package bjc.utils.components; + +import bjc.funcdata.ListEx; +import bjc.funcdata.MapEx; + +/** + * A collection of implementations of a particular type of + * {@link DescribedComponent}. + * + * @author ben + * + * @param + * The type of components contained in this repository. + */ +public interface ComponentRepository { + /** + * Get all of the components this repository knows about. + * + * @return A map from component name to component, containing all of the + * components in the repositories. + */ + public MapEx getAll(); + + /** + * Get a component with a specific name. + * + * @param name + * The name of the component to retrieve. + * + * @return The named component, or null if no component with that name exists. + */ + public ComponentType getByName(String name); + + /** + * Get a list of all the registered components. + * + * @return A list of all the registered components. + */ + public default ListEx getList() { + return getAll().valueList(); + } + + /** + * Get the source from which these components came. + * + * @return The source from which these components came. + */ + public String getSource(); +} -- cgit v1.2.3