HarvesterData { @Transient public int getValueAsInt() { return Integer.parseInt(value); }  @Id HarvesterDataId getId(); void setId(HarvesterDataId id); @Column(nullable = false, length = 255) String getValue(); void setValue(ISODate value); void setValue(String value); @Transient int getValueAsInt(); @Transient long getValueAsLong(); void setValue(long value); @Transient boolean getValueAsBoolean(); void setValue(boolean value); @Transient ISODate getValueAsDate(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testGetValueAsInt() throws Exception { final HarvesterData data = new HarvesterData(); data.setValue(1); assertEquals(1, data.getValueAsInt()); assertEquals(1, data.getValueAsLong()); data.setValue(100); assertEquals(100, data.getValueAsInt()); assertEquals(100, data.getValueAsLong()); }