@Test public void testMaxLongIsNaN() { LUndef lundef = new LUndef(); Assert.assertSame("NaN", lundef.execute(Long.MAX_VALUE, null)); }
public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final Object result; if( value instanceof Long ) { Long longValue = (Long) value; if (isDefined(longValue.longValue())){ result = "" + value; } else { result = "NaN"; } } else { try { result = Long.parseLong(value.toString()); } catch(final NumberFormatException e) { throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a Long", value), context, this, e); } } return next.execute(result, context); }
LUndef extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final Object result; if( value instanceof Long ) { Long longValue = (Long) value; if (isDefined(longValue.longValue())){ result = "" + value; } else { result = "NaN"; } } else { try { result = Long.parseLong(value.toString()); } catch(final NumberFormatException e) { throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a Long", value), context, this, e); } } return next.execute(result, context); } }
LUndef extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final Object result; if( value instanceof Long ) { Long longValue = (Long) value; if (isDefined(longValue.longValue())){ result = "" + value; } else { result = "NaN"; } } else { try { result = Long.parseLong(value.toString()); } catch(final NumberFormatException e) { throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a Long", value), context, this, e); } } return next.execute(result, context); } LUndef();  LUndef(final LongCellProcessor next); }
LUndef extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final Object result; if( value instanceof Long ) { Long longValue = (Long) value; if (isDefined(longValue.longValue())){ result = "" + value; } else { result = "NaN"; } } else { try { result = Long.parseLong(value.toString()); } catch(final NumberFormatException e) { throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a Long", value), context, this, e); } } return next.execute(result, context); } LUndef();  LUndef(final LongCellProcessor next); static boolean isDefined(final long value); Object execute(final Object value, final CsvContext context); }
LUndef extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final Object result; if( value instanceof Long ) { Long longValue = (Long) value; if (isDefined(longValue.longValue())){ result = "" + value; } else { result = "NaN"; } } else { try { result = Long.parseLong(value.toString()); } catch(final NumberFormatException e) { throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a Long", value), context, this, e); } } return next.execute(result, context); } LUndef();  LUndef(final LongCellProcessor next); static boolean isDefined(final long value); Object execute(final Object value, final CsvContext context);  }