/** * Get a new factory class-based service binding builder. * * @param <T> service type. * @param factoryType service factory class. * @param factoryScope factory scope. * @return initialized binding builder. */ public static <T> ServiceBindingBuilder<T> newFactoryBinder( Class<? extends Factory<T>> factoryType, Class<? extends Annotation> factoryScope) { return AbstractBindingBuilder.<T>createFactoryBinder(factoryType, factoryScope); }
/** * Get a new class-based service binding builder. * * <p>Does NOT bind the service type itself as a contract type. * * @param <T> service type. * @param serviceType service class. * @return initialized binding builder. */ public static <T> ServiceBindingBuilder<T> newBinder(Class<T> serviceType) { return AbstractBindingBuilder.create(serviceType, false); }
/** * Get a new instance-based service binding builder. The binding is naturally considered to be a * {@link javax.inject.Singleton singleton-scoped}. * * <p>Does NOT bind the service type itself as a contract type. * * @param <T> service type. * @param service service instance. * @return initialized binding builder. */ public static <T> ScopedBindingBuilder<T> newBinder(T service) { return AbstractBindingBuilder.create(service); }
/** * Get a new factory instance-based service binding builder. * * @param <T> service type. * @param factory service instance. * @return initialized binding builder. */ public static <T> ServiceBindingBuilder<T> newFactoryBinder(Factory<T> factory) { return AbstractBindingBuilder.createFactoryBinder(factory); }