public static EventBinder eventBinder(Binder binder) { return new EventBinder(binder); }
public void bindEventClient(Class<?>... types) { bindGenericEventClient(types); }
public void bindGenericEventClient(List<Class<?>> eventTypes) { Preconditions.checkNotNull(eventTypes, "eventTypes is null"); Preconditions.checkArgument(!eventTypes.isEmpty(), "eventTypes is empty"); Binder sourcedBinder = binder.withSource(getCaller()); Multibinder<EventTypeMetadata<?>> metadataBinder = Multibinder.newSetBinder(binder, new TypeLiteral<EventTypeMetadata<?>>() {}); // Bind event type metadata and bind any errors into Guice for (Class<?> eventType : eventTypes) { EventTypeMetadata<?> eventTypeMetadata = getEventTypeMetadata(eventType); metadataBinder.addBinding().toInstance(eventTypeMetadata); for (String error : eventTypeMetadata.getErrors()) { sourcedBinder.addError(error); } } }
public void bindGenericEventClient(List<Class<?>> eventTypes) { requireNonNull(eventTypes, "eventTypes is null"); Preconditions.checkArgument(!eventTypes.isEmpty(), "eventTypes is empty"); Binder sourcedBinder = binder.withSource(getCaller()); Multibinder<EventTypeMetadata<?>> metadataBinder = newSetBinder(binder, new TypeLiteral<EventTypeMetadata<?>>() {}); // Bind event type metadata and bind any errors into Guice for (Class<?> eventType : eventTypes) { EventTypeMetadata<?> eventTypeMetadata = getEventTypeMetadata(eventType); metadataBinder.addBinding().toInstance(eventTypeMetadata); for (String error : eventTypeMetadata.getErrors()) { sourcedBinder.addError(error); } } }
public void bindEventClient(Class<?>... types) { bindGenericEventClient(types); }
public static EventBinder eventBinder(Binder binder) { return new EventBinder(binder); }
public void bindGenericEventClient(Class<?>... eventTypes) { Preconditions.checkNotNull(eventTypes, "eventTypes is null"); bindGenericEventClient(ImmutableList.copyOf(eventTypes)); }
public void bindGenericEventClient(Class<?>... eventTypes) { requireNonNull(eventTypes, "eventTypes is null"); bindGenericEventClient(ImmutableList.copyOf(eventTypes)); }