@Override public Object toObject(String value) { if (value == null || value.length() == 0) { return null; } try { Long l = Long.parseLong(value); if (l.longValue() < 0) { throw newIllegalDataException("Value may not be negative(" + l + ")"); } return l; } catch (NumberFormatException e) { throw newIllegalDataException(e); } }
@Override public int toBytes(Object object, byte[] b, int o) { if (object == null) { throw newIllegalDataException(this + " may not be null"); } return this.getCodec().encodeLong(((Number) object).longValue(), b, o); }
@Override public Object toObject(String value) { if (value == null || value.length() == 0) { return null; } try { Long l = Long.parseLong(value); if (l.longValue() < 0) { throw newIllegalDataException("Value may not be negative(" + l + ")"); } return l; } catch (NumberFormatException e) { throw newIllegalDataException(e); } }
@Override public Object toObject(String value) { if (value == null || value.length() == 0) { return null; } try { Long l = Long.parseLong(value); if (l.longValue() < 0) { throw newIllegalDataException("Value may not be negative(" + l + ")"); } return l; } catch (NumberFormatException e) { throw newIllegalDataException(e); } }
@Override public int toBytes(Object object, byte[] b, int o) { if (object == null) { throw newIllegalDataException(this + " may not be null"); } return this.getCodec().encodeLong(((Number) object).longValue(), b, o); }
@Override public int toBytes(Object object, byte[] b, int o) { if (object == null) { throw newIllegalDataException(this + " may not be null"); } return this.getCodec().encodeLong(((Number) object).longValue(), b, o); }