Class Instances.Builder

    • Method Detail

      • add

        public <T> Instances.Builder add​(java.lang.Class<T> service,
                                         T instance)
        Add an instance of a service
        Type Parameters:
        T - The type of the service
        Parameters:
        service - The type of the service
        instance - The implementation of the service
        Returns:
        self
      • add

        public <T> Instances.Builder add​(TypeQualifier<T> service,
                                         T instance)
        Add an instance of a service
        Type Parameters:
        T - The type of the service
        Parameters:
        service - The qualified service type
        instance - The implementation of the service
        Returns:
        self
      • merge

        public Instances.Builder merge​(Instances other,
                                       boolean overwrite)
        Merge the specified set of instances into this set, overwriting any existing instances with the specified values
        Parameters:
        other - The values to merge into the set
        overwrite - Determines the merging behavior. If true then existing matches are replaced with the specified values, if false, existing values are retained, only values not already present are added
        Returns:
        self
      • remove

        public Instances.Builder remove​(java.lang.Class<?> type)
        Remove all providers of the specified type
        Parameters:
        type - The service type to remove
        Returns:
        self
      • remove

        public <T> Instances.Builder remove​(TypeQualifier<T> service)
        Remove all providers of the specified service
        Type Parameters:
        T - The type of the service
        Parameters:
        service - The qualified service
        Returns:
        self
      • set

        public <T> Instances.Builder set​(java.lang.Class<T> service,
                                         T instance)
        Set the sole provider of the specified service
        Type Parameters:
        T - The type of the service
        Parameters:
        service - The type of the service
        instance - The implementation of the service
        Returns:
        self
      • set

        public <T> Instances.Builder set​(TypeQualifier<T> qualifier,
                                         T instance)
        Set the sole implementation of the specified service
        Type Parameters:
        T - The type of the service
        Parameters:
        qualifier - The qualified service
        instance - The implementation of the service
        Returns:
        self
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object