@Test public void ensurePolymorphicInput() throws InputException { Class[] requestedTypes = {AnEnum.class, AnEnum.class}; String[] inputArgs = {"VAL_1", "VAL_5"}; Object[] output = typeHandler.instantiateTypes(requestedTypes, Arrays.asList(inputArgs)); assertTrue(output[0] instanceof AnEnum); assertTrue(output[1] instanceof AnEnum); Assertions.assertEquals(AnEnum.VAL_1, output[0]); Assertions.assertEquals(AnEnum.VAL_5, output[1]); }
public @NotNull Object[] instantiateTypes(Class<?>[] classes, List<String> input) throws InputException { return instantiateTypes(classes, input, null); }
TypeHandler { public @NotNull Object[] instantiateTypes(Class<?>[] classes, List<String> input) throws InputException { return instantiateTypes(classes, input, null); } }
TypeHandler { public @NotNull Object[] instantiateTypes(Class<?>[] classes, List<String> input) throws InputException { return instantiateTypes(classes, input, null); } TypeHandler(Logger logger); }
TypeHandler { public @NotNull Object[] instantiateTypes(Class<?>[] classes, List<String> input) throws InputException { return instantiateTypes(classes, input, null); } TypeHandler(Logger logger); @Nullable String getOutputFor(@Nullable Object object); @NotNull Object[] instantiateTypes(Class<?>[] classes, List<String> input); @NotNull Object[] instantiateTypes(Class<?>[] classes, List<String> input, @Nullable PlatformSender<?> sender); boolean registerHandler(Handler handler); @Nullable IHandler getIHandlerForClass(Class<?> clazz); @NotNull Collection<IHandler> getAllInputHandlers(); @NotNull Collection<OHandler> getAllOutputHandlers(); }
TypeHandler { public @NotNull Object[] instantiateTypes(Class<?>[] classes, List<String> input) throws InputException { return instantiateTypes(classes, input, null); } TypeHandler(Logger logger); @Nullable String getOutputFor(@Nullable Object object); @NotNull Object[] instantiateTypes(Class<?>[] classes, List<String> input); @NotNull Object[] instantiateTypes(Class<?>[] classes, List<String> input, @Nullable PlatformSender<?> sender); boolean registerHandler(Handler handler); @Nullable IHandler getIHandlerForClass(Class<?> clazz); @NotNull Collection<IHandler> getAllInputHandlers(); @NotNull Collection<OHandler> getAllOutputHandlers();  }