Class DelegatingServiceBuilder<T>

    • Constructor Detail

      • DelegatingServiceBuilder

        public DelegatingServiceBuilder​(ServiceBuilder<T> delegate)
        Construct a new instance.
        Parameters:
        delegate - the builder to delegate to
    • Method Detail

      • getDelegate

        protected ServiceBuilder<T> getDelegate()
        Get the ServiceBuilder delegate.
        Returns:
        ServiceBuilder delegate
      • requires

        public <V> Supplier<V> requires​(ServiceName name)
        Specifies value name required by service. There can be multiple values service may depend on.
        Specified by:
        requires in interface ServiceBuilder<T>
        Type Parameters:
        V - required dependency value type
        Parameters:
        name - required dependency name
        Returns:
        readonly dependency reference
      • provides

        public <V> Consumer<V> provides​(ServiceName... names)
        Specifies value provided by service. There can be multiple names for the same value. At least one name parameter must be provided to this method. If there are more names in the vararg array then the first one is called provided value name and other are called provided value aliases.
        Specified by:
        provides in interface ServiceBuilder<T>
        Type Parameters:
        V - provided value type
        Parameters:
        names - provided value name (and its aliases)
        Returns:
        writable dependency reference
      • addDependency

        @Deprecated
        public <I> ServiceBuilder<T> addDependency​(ServiceName dependency,
                                                   Class<I> type,
                                                   Injector<I> target)
        Deprecated.
        Add a service dependency. The type of the dependency is checked before it is passed into the (type-safe) injector instance. Calling this method multiple times for the same service name will only add it as a dependency one time; however this may be useful to specify multiple injections for one dependency.
        Specified by:
        addDependency in interface ServiceBuilder<T>
        Type Parameters:
        I - the type of the value of the dependency
        Parameters:
        dependency - the name of the dependency
        type - the class of the value of the dependency
        target - the injector into which the dependency should be stored
        Returns:
        this builder