From c82e3b3b2de0633317ec8fc85925e91422820597 Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Sun, 8 Oct 2017 22:39:59 -0300 Subject: Start splitting into maven modules --- .../bjc/utils/components/IComponentRepository.java | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 base/src/main/java/bjc/utils/components/IComponentRepository.java (limited to 'base/src/main/java/bjc/utils/components/IComponentRepository.java') diff --git a/base/src/main/java/bjc/utils/components/IComponentRepository.java b/base/src/main/java/bjc/utils/components/IComponentRepository.java new file mode 100644 index 0000000..6ee51f3 --- /dev/null +++ b/base/src/main/java/bjc/utils/components/IComponentRepository.java @@ -0,0 +1,49 @@ +package bjc.utils.components; + +import bjc.utils.funcdata.IList; +import bjc.utils.funcdata.IMap; + +/** + * A collection of implementations of a particular type of + * {@link IDescribedComponent} + * + * @author ben + * + * @param + * The type of components contained in this repository + */ +public interface IComponentRepository { + /** + * 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 IMap 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 IList getList() { + return getAll().valueList(); + } + + /** + * Get the source from which these components came + * + * @return The source from which these components came + */ + public String getSource(); +} \ No newline at end of file -- cgit v1.2.3