21 package org.matsim.core.modal;
23 import java.lang.annotation.Annotation;
24 import java.util.function.Function;
26 import jakarta.inject.Provider;
32 import com.google.inject.Key;
33 import com.google.inject.TypeLiteral;
34 import com.google.inject.binder.LinkedBindingBuilder;
53 return modalAnnotationCreator.
mode(mode);
56 protected final <T> Key<T>
modalKey(Class<T> type) {
57 return modalAnnotationCreator.
key(type, mode);
60 protected final <T> Key<T>
modalKey(TypeLiteral<T> typeLiteral) {
61 return modalAnnotationCreator.
key(typeLiteral, mode);
64 protected final <T> LinkedBindingBuilder<T>
bindModal(Class<T> type) {
68 protected final <T> LinkedBindingBuilder<T>
bindModal(TypeLiteral<T> typeLiteral) {
92 throw new UnsupportedOperationException(
93 "Very likely you wanted to call addQSimComponentBinding() or addModalQSimComponentBinding()");
100 protected final <T extends QSimComponent>
void addModalComponent(Class<T> componentClass, Key<? extends T> key) {
101 bindModal(componentClass).to(key).asEagerSingleton();
106 Provider<? extends T> componentProvider) {
107 bindModal(componentClass).toProvider(componentProvider).asEagerSingleton();
112 Class<? extends T> implementation) {
113 bindModal(componentClass).to(implementation).asEagerSingleton();
final ModalAnnotationCreator< M > modalAnnotationCreator
static< M extends Annotation, T > Provider< T > createProvider(String mode, ModalAnnotationCreator< M > modalAnnotationCreator, Function< InstanceGetter< M >, T > delegate)
final< T > LinkedBindingBuilder< T > bindModal(Class< T > type)
AbstractModalQSimModule(String mode, ModalAnnotationCreator< M > modalAnnotationCreator)
final< T extends QSimComponent > void addModalComponent(Class< T > componentClass, Key<? extends T > key)
final< T extends QSimComponent > void addModalComponent(Class< T > componentClass, Provider<? extends T > componentProvider)
final LinkedBindingBuilder< QSimComponent > addQSimComponentBinding(Annotation annotation)
final< T > Key< T > modalKey(Class< T > type)
final M getModalAnnotation()
default< T > Key< T > key(Class< T > type, String mode)
final< T > Provider< T > modalProvider(Function< ModalProviders.InstanceGetter< M >, T > delegate)
final< T > LinkedBindingBuilder< T > bindModal(TypeLiteral< T > typeLiteral)
final< T extends QSimComponent > void addModalComponent(Class< T > componentClass)
final< T > Key< T > modalKey(TypeLiteral< T > typeLiteral)
final< T extends QSimComponent > void addModalComponent(Class< T > componentClass, Class<? extends T > implementation)
final LinkedBindingBuilder< MobsimListener > addMobsimListenerBinding()
final LinkedBindingBuilder< QSimComponent > addModalQSimComponentBinding()