return DoubleType.instance.decompose(Double.valueOf(value.toString()));
public double getDouble(String column) { return DoubleType.instance.compose(data.get(column)); }
@Override public Term fromJSONObject(Object parsed) throws MarshalException { try { if (parsed instanceof String) return new Constants.Value(fromString((String) parsed)); else return new Constants.Value(getSerializer().serialize(((Number) parsed).doubleValue())); } catch (ClassCastException exc) { throw new MarshalException(String.format( "Expected a double value, but got a %s: %s", parsed.getClass().getSimpleName(), parsed)); } }
@Override public String toJSONString(ByteBuffer buffer, ProtocolVersion protocolVersion) { return getSerializer().deserialize(buffer).toString(); }
@Override public Term fromJSONObject(Object parsed) throws MarshalException { try { if (parsed instanceof String) return new Constants.Value(fromString((String) parsed)); else return new Constants.Value(getSerializer().serialize(((Number) parsed).doubleValue())); } catch (ClassCastException exc) { throw new MarshalException(String.format( "Expected a double value, but got a %s: %s", parsed.getClass().getSimpleName(), parsed)); } }
@Override public String toJSONString(ByteBuffer buffer, ProtocolVersion protocolVersion) { return getSerializer().deserialize(buffer).toString(); }
public ByteBuffer fromString(String source) throws MarshalException { // Return an empty ByteBuffer for an empty string. if (source.isEmpty()) return ByteBufferUtil.EMPTY_BYTE_BUFFER; Double d; try { d = Double.valueOf(source); } catch (NumberFormatException e1) { throw new MarshalException(String.format("unable to coerce '%s' to a double", source), e1); } return decompose(d); }
@Override public Term fromJSONObject(Object parsed) throws MarshalException { try { if (parsed instanceof String) return new Constants.Value(fromString((String) parsed)); else return new Constants.Value(getSerializer().serialize(((Number) parsed).doubleValue())); } catch (ClassCastException exc) { throw new MarshalException(String.format( "Expected a double value, but got a %s: %s", parsed.getClass().getSimpleName(), parsed)); } }
public double getDouble(String column) { return DoubleType.instance.compose(data.get(column)); }
@Override public String toJSONString(ByteBuffer buffer, ProtocolVersion protocolVersion) { return getSerializer().deserialize(buffer).toString(); }
public ByteBuffer fromString(String source) throws MarshalException { // Return an empty ByteBuffer for an empty string. if (source.isEmpty()) return ByteBufferUtil.EMPTY_BYTE_BUFFER; Double d; try { d = Double.valueOf(source); } catch (NumberFormatException e1) { throw new MarshalException(String.format("Unable to make double from '%s'", source), e1); } return decompose(d); }
@Override public Term fromJSONObject(Object parsed) throws MarshalException { try { if (parsed instanceof String) return new Constants.Value(fromString((String) parsed)); else return new Constants.Value(getSerializer().serialize(((Number) parsed).doubleValue())); } catch (ClassCastException exc) { throw new MarshalException(String.format( "Expected a double value, but got a %s: %s", parsed.getClass().getSimpleName(), parsed)); } }
public double getDouble(String column) { return DoubleType.instance.compose(data.get(column)); }
@Override public String toJSONString(ByteBuffer buffer, ProtocolVersion protocolVersion) { return getSerializer().deserialize(buffer).toString(); }
public ByteBuffer fromString(String source) throws MarshalException { // Return an empty ByteBuffer for an empty string. if (source.isEmpty()) return ByteBufferUtil.EMPTY_BYTE_BUFFER; Double d; try { d = Double.valueOf(source); } catch (NumberFormatException e1) { throw new MarshalException(String.format("Unable to make double from '%s'", source), e1); } return decompose(d); }
public double getDouble(String column) { return DoubleType.instance.compose(data.get(column)); }
public ByteBuffer fromString(String source) throws MarshalException { // Return an empty ByteBuffer for an empty string. if (source.isEmpty()) return ByteBufferUtil.EMPTY_BYTE_BUFFER; Double d; try { d = Double.valueOf(source); } catch (NumberFormatException e1) { throw new MarshalException(String.format("Unable to make double from '%s'", source), e1); } return decompose(d); }
public ByteBuffer fromString(String source) throws MarshalException { // Return an empty ByteBuffer for an empty string. if (source.isEmpty()) return ByteBufferUtil.EMPTY_BYTE_BUFFER; Double d; try { d = Double.valueOf(source); } catch (NumberFormatException e1) { throw new MarshalException(String.format("Unable to make double from '%s'", source), e1); } return decompose(d); }