@Test public void testConvert_String() { assertEquals("abc cde ", converter.convert("abc cde ")); }
public String convert(Object val) { if (val == null) { return null; } String converted; if (val instanceof String) { converted = val.toString(); } else if (val instanceof InetAddress) { converted = val.toString(); } else if (val instanceof UUID) { converted = val.toString(); } else if (val instanceof Date) { converted = dateFomrat.get().format(val); } else if (val instanceof LocalDateTime) { converted = timeFormatter.format((LocalDateTime) val); } else if (val instanceof BigInteger) { converted = val.toString(); } else if (val instanceof Double) { converted = Double.toString((Double) val); } else if (val instanceof BigDecimal) { converted = val.toString(); } else if (val instanceof Boolean) { converted = Boolean.toString((Boolean) val); } else if (val instanceof Integer) { converted = Integer.toString((Integer) val); } else if (val instanceof Long) { converted = Long.toString((Long) val); } else if (val instanceof Float) { converted = Float.toString((Float) val); } else { LOG.warn("Could not find mapping for type: {}", val.getClass()); converted = val.toString(); } LOG.trace("Converted: {} to {}", val, converted); return converted; }
DataConverter { public String convert(Object val) { if (val == null) { return null; } String converted; if (val instanceof String) { converted = val.toString(); } else if (val instanceof InetAddress) { converted = val.toString(); } else if (val instanceof UUID) { converted = val.toString(); } else if (val instanceof Date) { converted = dateFomrat.get().format(val); } else if (val instanceof LocalDateTime) { converted = timeFormatter.format((LocalDateTime) val); } else if (val instanceof BigInteger) { converted = val.toString(); } else if (val instanceof Double) { converted = Double.toString((Double) val); } else if (val instanceof BigDecimal) { converted = val.toString(); } else if (val instanceof Boolean) { converted = Boolean.toString((Boolean) val); } else if (val instanceof Integer) { converted = Integer.toString((Integer) val); } else if (val instanceof Long) { converted = Long.toString((Long) val); } else if (val instanceof Float) { converted = Float.toString((Float) val); } else { LOG.warn("Could not find mapping for type: {}", val.getClass()); converted = val.toString(); } LOG.trace("Converted: {} to {}", val, converted); return converted; } }
DataConverter { public String convert(Object val) { if (val == null) { return null; } String converted; if (val instanceof String) { converted = val.toString(); } else if (val instanceof InetAddress) { converted = val.toString(); } else if (val instanceof UUID) { converted = val.toString(); } else if (val instanceof Date) { converted = dateFomrat.get().format(val); } else if (val instanceof LocalDateTime) { converted = timeFormatter.format((LocalDateTime) val); } else if (val instanceof BigInteger) { converted = val.toString(); } else if (val instanceof Double) { converted = Double.toString((Double) val); } else if (val instanceof BigDecimal) { converted = val.toString(); } else if (val instanceof Boolean) { converted = Boolean.toString((Boolean) val); } else if (val instanceof Integer) { converted = Integer.toString((Integer) val); } else if (val instanceof Long) { converted = Long.toString((Long) val); } else if (val instanceof Float) { converted = Float.toString((Float) val); } else { LOG.warn("Could not find mapping for type: {}", val.getClass()); converted = val.toString(); } LOG.trace("Converted: {} to {}", val, converted); return converted; } protected  DataConverter(); }
DataConverter { public String convert(Object val) { if (val == null) { return null; } String converted; if (val instanceof String) { converted = val.toString(); } else if (val instanceof InetAddress) { converted = val.toString(); } else if (val instanceof UUID) { converted = val.toString(); } else if (val instanceof Date) { converted = dateFomrat.get().format(val); } else if (val instanceof LocalDateTime) { converted = timeFormatter.format((LocalDateTime) val); } else if (val instanceof BigInteger) { converted = val.toString(); } else if (val instanceof Double) { converted = Double.toString((Double) val); } else if (val instanceof BigDecimal) { converted = val.toString(); } else if (val instanceof Boolean) { converted = Boolean.toString((Boolean) val); } else if (val instanceof Integer) { converted = Integer.toString((Integer) val); } else if (val instanceof Long) { converted = Long.toString((Long) val); } else if (val instanceof Float) { converted = Float.toString((Float) val); } else { LOG.warn("Could not find mapping for type: {}", val.getClass()); converted = val.toString(); } LOG.trace("Converted: {} to {}", val, converted); return converted; } protected  DataConverter(); String trimColumnContent(String content, boolean embeddedColumn); String trimColumnTooltipContent(String content); String convert(Object val); }
DataConverter { public String convert(Object val) { if (val == null) { return null; } String converted; if (val instanceof String) { converted = val.toString(); } else if (val instanceof InetAddress) { converted = val.toString(); } else if (val instanceof UUID) { converted = val.toString(); } else if (val instanceof Date) { converted = dateFomrat.get().format(val); } else if (val instanceof LocalDateTime) { converted = timeFormatter.format((LocalDateTime) val); } else if (val instanceof BigInteger) { converted = val.toString(); } else if (val instanceof Double) { converted = Double.toString((Double) val); } else if (val instanceof BigDecimal) { converted = val.toString(); } else if (val instanceof Boolean) { converted = Boolean.toString((Boolean) val); } else if (val instanceof Integer) { converted = Integer.toString((Integer) val); } else if (val instanceof Long) { converted = Long.toString((Long) val); } else if (val instanceof Float) { converted = Float.toString((Float) val); } else { LOG.warn("Could not find mapping for type: {}", val.getClass()); converted = val.toString(); } LOG.trace("Converted: {} to {}", val, converted); return converted; } protected  DataConverter(); String trimColumnContent(String content, boolean embeddedColumn); String trimColumnTooltipContent(String content); String convert(Object val); final static String EMPTY_COL_VALUE; }