/** * Compose. * * @param value * the value * @param clazz * the clazz * @return the byte[] */ private static byte[] compose(Object value, Class clazz) { return DecimalType.instance.decompose((BigDecimal) value).array(); }
private static byte[] compose(Object value, Class clazz) { return DecimalType.instance.decompose((BigDecimal) value).array(); }
public ByteBuffer fromString(String source) throws MarshalException { // Return an empty ByteBuffer for an empty string. if (source.isEmpty()) return ByteBufferUtil.EMPTY_BYTE_BUFFER; BigDecimal decimal; try { decimal = new BigDecimal(source); } catch (Exception e) { throw new MarshalException(String.format("unable to make BigDecimal from '%s'", source), e); } return decompose(decimal); }
public ByteBuffer fromString(String source) throws MarshalException { // Return an empty ByteBuffer for an empty string. if (source.isEmpty()) return ByteBufferUtil.EMPTY_BYTE_BUFFER; BigDecimal decimal; try { decimal = new BigDecimal(source); } catch (Exception e) { throw new MarshalException(String.format("unable to make BigDecimal from '%s'", source), e); } return decompose(decimal); }
public ByteBuffer fromString(String source) throws MarshalException { // Return an empty ByteBuffer for an empty string. if (source.isEmpty()) return ByteBufferUtil.EMPTY_BYTE_BUFFER; BigDecimal decimal; try { decimal = new BigDecimal(source); } catch (Exception e) { throw new MarshalException(String.format("unable to make BigDecimal from '%s'", source), e); } return decompose(decimal); }
public ByteBuffer fromString(String source) throws MarshalException { // Return an empty ByteBuffer for an empty string. if (source.isEmpty()) return ByteBufferUtil.EMPTY_BYTE_BUFFER; BigDecimal decimal; try { decimal = new BigDecimal(source); } catch (Exception e) { throw new MarshalException(String.format("unable to make BigDecimal from '%s'", source), e); } return decompose(decimal); }
public ByteBuffer fromString(String source) throws MarshalException { // Return an empty ByteBuffer for an empty string. if (source.isEmpty()) return ByteBufferUtil.EMPTY_BYTE_BUFFER; BigDecimal decimal; try { decimal = new BigDecimal(source); } catch (Exception e) { throw new MarshalException(String.format("unable to make BigDecimal from '%s'", source), e); } return decompose(decimal); }