Class RepoMaster


  • public class RepoMaster
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.Class<?>,​Repo> repoMap  
    • Constructor Summary

      Constructors 
      Constructor Description
      RepoMaster​(java.util.Collection<Repo<?>> repos)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> void registerIfAbsent​(Repo<T> repo)
      Registers a repo if one is not already registered
      <T> Repo<T> repo​(java.lang.Class<T> type)
      Returns the repo for the type specified
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • repoMap

        private final java.util.Map<java.lang.Class<?>,​Repo> repoMap
    • Constructor Detail

      • RepoMaster

        public RepoMaster​(java.util.Collection<Repo<?>> repos)
        Constructor
        Parameters:
        repos - the collection of repos
    • Method Detail

      • registerIfAbsent

        public <T> void registerIfAbsent​(Repo<T> repo)
        Registers a repo if one is not already registered
        Type Parameters:
        T - the repo type
        Parameters:
        repo - the repo to register
      • repo

        public <T> Repo<T> repo​(java.lang.Class<T> type)
        Returns the repo for the type specified
        Type Parameters:
        T - the repo type
        Parameters:
        type - the data type
        Returns:
        the repo match