@Test(expected = IllegalArgumentException.class) public void testPutPrivateInterfaceIsNotAllowed() { final EchoService2 echoService2 = msg -> msg; assertThat(GLOBAL_OBJECT_REGISTRY.put(new ObjectRegistration<>(EchoService2_TYPE, echoService2)).isPresent(), is(false)); }
public <A> Optional<A> put(@NonNull final ObjectRegistration<A> objectRegistration) { final Optional<A> formerValue = put(objectRegistration.getType(), objectRegistration.getObject()); eventBus.post(objectRegistration); return formerValue; }
TypeSafeObjectRegistry { public <A> Optional<A> put(@NonNull final ObjectRegistration<A> objectRegistration) { final Optional<A> formerValue = put(objectRegistration.getType(), objectRegistration.getObject()); eventBus.post(objectRegistration); return formerValue; } }
TypeSafeObjectRegistry { public <A> Optional<A> put(@NonNull final ObjectRegistration<A> objectRegistration) { final Optional<A> formerValue = put(objectRegistration.getType(), objectRegistration.getObject()); eventBus.post(objectRegistration); return formerValue; } TypeSafeObjectRegistry(); }
TypeSafeObjectRegistry { public <A> Optional<A> put(@NonNull final ObjectRegistration<A> objectRegistration) { final Optional<A> formerValue = put(objectRegistration.getType(), objectRegistration.getObject()); eventBus.post(objectRegistration); return formerValue; } TypeSafeObjectRegistry(); EventBus getEventBus(); Optional<A> put(@NonNull final ObjectRegistration<A> objectRegistration); Optional<A> put(@NonNull final TypeReference<A> type, @NonNull final A obj); Optional<A> remove(@NonNull final TypeReference<?> type); void clear(); Optional<A> get(@NonNull final TypeReference<A> type); Set<TypeReference<?>> getRegisteredTypes(); }
TypeSafeObjectRegistry { public <A> Optional<A> put(@NonNull final ObjectRegistration<A> objectRegistration) { final Optional<A> formerValue = put(objectRegistration.getType(), objectRegistration.getObject()); eventBus.post(objectRegistration); return formerValue; } TypeSafeObjectRegistry(); EventBus getEventBus(); Optional<A> put(@NonNull final ObjectRegistration<A> objectRegistration); Optional<A> put(@NonNull final TypeReference<A> type, @NonNull final A obj); Optional<A> remove(@NonNull final TypeReference<?> type); void clear(); Optional<A> get(@NonNull final TypeReference<A> type); Set<TypeReference<?>> getRegisteredTypes(); static final TypeSafeObjectRegistry GLOBAL_OBJECT_REGISTRY; }