@Test public void ensureNullInputGivesNullOutput() { String output = typeHandler.getOutputFor(null); assertNull(output); }
public @Nullable String getOutputFor(@Nullable Object object) { if (object == null) { return null; } OHandler handler = getOHandlerForClass(object.getClass()); if (handler != null) { return handler.getFormattedOutput(object); } else { return String.valueOf(object); } }
TypeHandler { public @Nullable String getOutputFor(@Nullable Object object) { if (object == null) { return null; } OHandler handler = getOHandlerForClass(object.getClass()); if (handler != null) { return handler.getFormattedOutput(object); } else { return String.valueOf(object); } } }
TypeHandler { public @Nullable String getOutputFor(@Nullable Object object) { if (object == null) { return null; } OHandler handler = getOHandlerForClass(object.getClass()); if (handler != null) { return handler.getFormattedOutput(object); } else { return String.valueOf(object); } } TypeHandler(Logger logger); }
TypeHandler { public @Nullable String getOutputFor(@Nullable Object object) { if (object == null) { return null; } OHandler handler = getOHandlerForClass(object.getClass()); if (handler != null) { return handler.getFormattedOutput(object); } else { return String.valueOf(object); } } 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 @Nullable String getOutputFor(@Nullable Object object) { if (object == null) { return null; } OHandler handler = getOHandlerForClass(object.getClass()); if (handler != null) { return handler.getFormattedOutput(object); } else { return String.valueOf(object); } } 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();  }