@Override public RefedInterface1 getValue() { return notNull ? new RefedInterface1Impl().setString("the_string_value") : null; } };
@Override public GenericNullableRefedInterface<RefedInterface1> methodWithGenericNullableApiReturn(boolean notNull) { return new GenericNullableRefedInterface<RefedInterface1>() { @Override public RefedInterface1 getValue() { return notNull ? new RefedInterface1Impl().setString("the_string_value") : null; } }; }
@Test public void testMethodWithGenericHandlerAsyncResult() { AsyncResultChecker checker = new AsyncResultChecker(); obj.methodWithGenericHandlerAsyncResult("String", checker.asyncExpectedResult("foo")); obj.methodWithGenericHandlerAsyncResult("Ref", checker.<RefedInterface1Impl>asyncResultHandler(it -> assertEquals("bar", it.getString()))); obj.methodWithGenericHandlerAsyncResult("JsonObject", checker.asyncExpectedResult(new JsonObject().put("foo", "hello").put("bar", 123))); obj.methodWithGenericHandlerAsyncResult("JsonArray", checker.asyncExpectedResult(new JsonArray().add("foo").add("bar").add("wib"))); assertEquals(4, checker.count); }
@Override public GenericNullableRefedInterface<RefedInterface1> methodWithGenericNullableApiReturn(boolean notNull) { return new GenericNullableRefedInterface<RefedInterface1>() { @Override public RefedInterface1 getValue() { return notNull ? new RefedInterface1Impl().setString("the_string_value") : null; } }; }
@Test public void testMethodWithGenericHandler() { AsyncResultChecker checker = new AsyncResultChecker(); obj.methodWithGenericHandler("String", checker.expectedResult("foo")); obj.methodWithGenericHandler("Ref", checker.<RefedInterface1Impl>resultHandler(it -> assertEquals("bar", it.getString()))); obj.methodWithGenericHandler("JsonObject", checker.expectedResult(new JsonObject().put("foo", "hello").put("bar", 123))); obj.methodWithGenericHandler("JsonArray", checker.expectedResult(new JsonArray().add("foo").add("bar").add("wib"))); assertEquals(4, checker.count); }
@Override public RefedInterface1 getValue() { return notNull ? new RefedInterface1Impl().setString("the_string_value") : null; } };
@Override public GenericNullableRefedInterface<RefedInterface1> methodWithGenericNullableApiReturn(boolean notNull) { return new GenericNullableRefedInterface<RefedInterface1>() { @Override public RefedInterface1 getValue() { return notNull ? new RefedInterface1Impl().setString("the_string_value") : null; } }; }
@Test public void testMethodWithGenericObservable() throws Exception { assertEquals("foo", get(obj.methodWithGenericHandlerAsyncResultObservable("String"))); RefedInterface1Impl ref = get(obj.<RefedInterface1Impl>methodWithGenericHandlerAsyncResultObservable("Ref")); assertEquals("bar", ref.getString()); assertEquals(new JsonObject().put("foo", "hello").put("bar", 123), get(obj.methodWithGenericHandlerAsyncResultObservable("JsonObject"))); assertEquals(new JsonArray().add("foo").add("bar").add("wib"), get(obj.methodWithGenericHandlerAsyncResultObservable("JsonArray"))); }
@Override public RefedInterface1 getValue() { return notNull ? new RefedInterface1Impl().setString("the_string_value") : null; } };
@Override public RefedInterface1 methodWithCachedReturn(String foo) { RefedInterface1 refed = new RefedInterface1Impl(); refed.setString(foo); return refed; }
@Override public RefedInterface1 getValue() { return notNull ? new RefedInterface1Impl().setString("the_string_value") : null; } };
static RefedInterface1 staticFactoryMethod(String foo) { RefedInterface1 refed = new RefedInterface1Impl(); refed.setString(foo); return refed; }
@Override public RefedInterface1 getValue() { return notNull ? new RefedInterface1Impl().setString("the_string_value") : null; } };
@Override public void methodWithHandlerUserTypes(Handler<RefedInterface1> handler) { RefedInterface1 refed = new RefedInterface1Impl(); refed.setString("echidnas"); handler.handle(refed); }
@Override public List<RefedInterface1> methodWithListVertxGenReturn() { return Arrays.asList(new RefedInterface1Impl().setString("foo"), new RefedInterface1Impl().setString("bar")); }
@Override public void methodWithHandlerAsyncResultUserTypes(Handler<AsyncResult<RefedInterface1>> handler) { RefedInterface1 refed = new RefedInterface1Impl(); refed.setString("cheetahs"); handler.handle(Future.succeededFuture(refed)); }
@Override public List<RefedInterface1> methodWithCachedListReturn() { return Arrays.asList(new RefedInterface1Impl().setString("foo"), new RefedInterface1Impl().setString("bar")); }
@Override public RefedInterface1 methodWithCachedReturn(String foo) { RefedInterface1 refed = new RefedInterface1Impl(); refed.setString(foo); return refed; }
@Override public List<RefedInterface1> methodWithListVertxGenReturn() { return Arrays.asList(new RefedInterface1Impl().setString("foo"), new RefedInterface1Impl().setString("bar")); }
@Override public void methodWithHandlerUserTypes(Handler<RefedInterface1> handler) { RefedInterface1 refed = new RefedInterface1Impl(); refed.setString("echidnas"); handler.handle(refed); }