@Test(groups = "fast") public void testConvertToLongFail() throws Exception { try { final DataItem item = new StringDataItem("a string"); item.getLong(); Assert.fail("expected NumberFormatException NOT thrown"); } catch (Exception e) { Assert.assertEquals(e.getClass(), NumberFormatException.class); } }
@Override public Long getLong() { if (value.isEmpty()) { return (long) 0; } return Long.valueOf(value); }
StringDataItem implements DataItem { @Override public Long getLong() { if (value.isEmpty()) { return (long) 0; } return Long.valueOf(value); } }
StringDataItem implements DataItem { @Override public Long getLong() { if (value.isEmpty()) { return (long) 0; } return Long.valueOf(value); } StringDataItem();  StringDataItem(final String value); }
StringDataItem implements DataItem { @Override public Long getLong() { if (value.isEmpty()) { return (long) 0; } return Long.valueOf(value); } StringDataItem();  StringDataItem(final String value); @Override Boolean getBoolean(); @Override Byte getByte(); @Override Integer getInteger(); @Override Short getShort(); @Override Long getLong(); @Override String getString(); @Override Double getDouble(); @Override Comparable getComparable(); @Override int compareTo(final Object o); @Override int hashCode(); @Override boolean equals(final Object o); @Override void write(final DataOutput out); @Override void readFields(final DataInput in); @Override String toString(); @Override byte getThriftType(); }
StringDataItem implements DataItem { @Override public Long getLong() { if (value.isEmpty()) { return (long) 0; } return Long.valueOf(value); } StringDataItem();  StringDataItem(final String value); @Override Boolean getBoolean(); @Override Byte getByte(); @Override Integer getInteger(); @Override Short getShort(); @Override Long getLong(); @Override String getString(); @Override Double getDouble(); @Override Comparable getComparable(); @Override int compareTo(final Object o); @Override int hashCode(); @Override boolean equals(final Object o); @Override void write(final DataOutput out); @Override void readFields(final DataInput in); @Override String toString(); @Override byte getThriftType();  }