public ByteBuffer fromString(String source) throws MarshalException { // Return an empty ByteBuffer for an empty string. if (source.isEmpty()) return ByteBufferUtil.EMPTY_BYTE_BUFFER; return decompose(Duration.from(source)); }
public Term fromJSONObject(Object parsed) throws MarshalException { try { return new Constants.Value(fromString((String) parsed)); } catch (ClassCastException exc) { throw new MarshalException(String.format("Expected a string representation of a duration, but got a %s: %s", parsed.getClass().getSimpleName(), parsed)); } }
@Override public String toJSONString(ByteBuffer buffer, ProtocolVersion protocolVersion) { return getSerializer().deserialize(buffer).toString(); }
@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; return decompose(Duration.from(source)); }
@Override public String toJSONString(ByteBuffer buffer, ProtocolVersion protocolVersion) { return getSerializer().deserialize(buffer).toString(); }
public Term fromJSONObject(Object parsed) throws MarshalException { try { return new Constants.Value(fromString((String) parsed)); } catch (ClassCastException exc) { throw new MarshalException(String.format("Expected a string representation of a duration, but got a %s: %s", parsed.getClass().getSimpleName(), parsed)); } }
public ByteBuffer fromString(String source) throws MarshalException { // Return an empty ByteBuffer for an empty string. if (source.isEmpty()) return ByteBufferUtil.EMPTY_BYTE_BUFFER; return decompose(Duration.from(source)); }
@Override public String toJSONString(ByteBuffer buffer, ProtocolVersion protocolVersion) { return getSerializer().deserialize(buffer).toString(); }
public Term fromJSONObject(Object parsed) throws MarshalException { try { return new Constants.Value(fromString((String) parsed)); } catch (ClassCastException exc) { throw new MarshalException(String.format("Expected a string representation of a duration, but got a %s: %s", parsed.getClass().getSimpleName(), parsed)); } }
public ByteBuffer fromString(String source) throws MarshalException { // Return an empty ByteBuffer for an empty string. if (source.isEmpty()) return ByteBufferUtil.EMPTY_BYTE_BUFFER; return decompose(Duration.from(source)); }
public Term fromJSONObject(Object parsed) throws MarshalException { try { return new Constants.Value(fromString((String) parsed)); } catch (ClassCastException exc) { throw new MarshalException(String.format("Expected a string representation of a duration, but got a %s: %s", parsed.getClass().getSimpleName(), parsed)); } }