@Override public boolean equals(Object o) { return o instanceof RealMapBinder && ((RealMapBinder<?, ?>) o).mapKey.equals(mapKey); }
@Override public boolean equals(Object o) { return o instanceof RealMultibinder && ((RealMultibinder<?>) o).setKey.equals(setKey); }
@Override public Void visit(LinkedKeyBinding<? extends T> binding) { Key<? extends T> linkedKey = binding.getLinkedKey(); if (key.equals(linkedKey)) { errors.recursiveBinding(); } FactoryProxy<T> factory = new FactoryProxy<>(injector, key, linkedKey, source); creationListeners.add(factory); InternalFactory<? extends T> scopedFactory = Scopes.scope(key, injector, factory, scoping); putBinding( new LinkedBindingImpl<>(injector, key, source, scopedFactory, scoping, linkedKey)); return null; }
@Override public boolean equals(Object o) { return o instanceof RealMapBinder && ((RealMapBinder<?, ?>) o).mapKey.equals(mapKey); }
@Override public boolean equals(Object o) { return o instanceof RealMapBinder && ((RealMapBinder<?, ?>) o).mapKey.equals(mapKey); }
@Override public boolean equals(Object o) { return o instanceof RealMultibinder && ((RealMultibinder<?>) o).setKey.equals(setKey); }
@Override public boolean equals(Object o) { return o instanceof RealMultibinder && ((RealMultibinder<?>) o).setKey.equals(setKey); }
@Override public boolean equals(Object o) { return o instanceof RealMapBinder && ((RealMapBinder<?, ?>) o).mapKey.equals(mapKey); }
@Override public boolean equals(Object o) { return o instanceof RealMultibinder && ((RealMultibinder<?>) o).setKey.equals(setKey); }
@Override public boolean equals(Object o) { return o instanceof RealMultibinder && ((RealMultibinder<?>) o).setKey.equals(setKey); }
@Override public boolean equals(Object o) { return o instanceof RealMapBinder && ((RealMapBinder<?, ?>) o).mapKey.equals(mapKey); }
@Override public Void visit(LinkedKeyBinding<? extends T> binding) { Key<? extends T> linkedKey = binding.getLinkedKey(); if (key.equals(linkedKey)) { errors.recursiveBinding(); } FactoryProxy<T> factory = new FactoryProxy<>(injector, key, linkedKey, source); creationListeners.add(factory); InternalFactory<? extends T> scopedFactory = Scopes.scope(key, injector, factory, scoping); putBinding( new LinkedBindingImpl<>(injector, key, source, scopedFactory, scoping, linkedKey)); return null; }
@Override public Void visit(LinkedKeyBinding<? extends T> binding) { Key<? extends T> linkedKey = binding.getLinkedKey(); if (key.equals(linkedKey)) { errors.recursiveBinding(); } FactoryProxy<T> factory = new FactoryProxy<>(injector, key, linkedKey, source); creationListeners.add(factory); InternalFactory<? extends T> scopedFactory = Scopes.scope(key, injector, factory, scoping); putBinding( new LinkedBindingImpl<>(injector, key, source, scopedFactory, scoping, linkedKey)); return null; }
@Override public Void visit(LinkedKeyBinding<? extends T> binding) { Key<? extends T> linkedKey = binding.getLinkedKey(); if (key.equals(linkedKey)) { errors.recursiveBinding(); } FactoryProxy<T> factory = new FactoryProxy<>(injector, key, linkedKey, source); creationListeners.add(factory); InternalFactory<? extends T> scopedFactory = Scopes.scope(key, injector, factory, scoping); putBinding( new LinkedBindingImpl<>(injector, key, source, scopedFactory, scoping, linkedKey)); return null; }
@Override public Void visit(LinkedKeyBinding<? extends T> binding) { Key<? extends T> linkedKey = binding.getLinkedKey(); if (key.equals(linkedKey)) { errors.recursiveBinding(); } FactoryProxy<T> factory = new FactoryProxy<>(injector, key, linkedKey, source); creationListeners.add(factory); InternalFactory<? extends T> scopedFactory = Scopes.scope(key, injector, factory, scoping); putBinding( new LinkedBindingImpl<>(injector, key, source, scopedFactory, scoping, linkedKey)); return null; }
@Override @SuppressWarnings("unchecked") // raw keys are necessary for the args array and return value protected void configure() { Binder binder = binder().withSource(method); int p = 0; for (Key<?> paramKey : paramTypes.get(method)) { // Wrap in a Provider to cover null, and to prevent Guice from injecting the parameter binder.bind((Key) paramKey).toProvider(Providers.of(args[p++])); } if (producedType != null && !returnType.equals(producedType)) { binder.bind(returnType).to((Key) producedType); } else { binder.bind(returnType); } } };