diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2018-06-02 19:45:31 -0300 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2018-06-02 21:25:44 -0300 |
| commit | f39711c88d027fc3b589a7d1f51b2b54eb2a016c (patch) | |
| tree | 8a038015ca4426389ce0780dd9b311ab474c679a /base/src/main/java/bjc/utils/components/MemoryComponentRepository.java | |
| parent | 84bbde06c9d24a1f2422478aa04b0122b3c51c2c (diff) | |
Add memory component repository
This component repository uses a in-memory map for storage
Diffstat (limited to 'base/src/main/java/bjc/utils/components/MemoryComponentRepository.java')
| -rw-r--r-- | base/src/main/java/bjc/utils/components/MemoryComponentRepository.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/base/src/main/java/bjc/utils/components/MemoryComponentRepository.java b/base/src/main/java/bjc/utils/components/MemoryComponentRepository.java new file mode 100644 index 0000000..4246016 --- /dev/null +++ b/base/src/main/java/bjc/utils/components/MemoryComponentRepository.java @@ -0,0 +1,29 @@ +package bjc.utils.components; + +public class MemoryComponentRepository<ComponentType extends IDescribedComponent> implements IComponentRepository<ComponentType> { + private final IMap<String, ComponentType> repo; + + private final String source; + + public MemoryComponentRepository(IMap<String, ComponentType> repo) { + this(repo, "memory"); + } + + public MemoryComponentRepository(IMap<String, ComponentType> repo, String source) { + this.repo = repo; + + this.source = source; + } + + public IMap<String, ComponentType> getAll() { + return repo; + } + + public ComponentType getByName(String name) { + return repo.get(); + } + + public String getSource() { + + } +} |
