public DirectBuffer getString() { if (!isString()) { throw new RuntimeException( String.format("expected String but found '%s'", token.getType())); } return token.getValueBuffer(); }
public DirectBuffer getString() { if (!isString()) { throw new RuntimeException( String.format("expected String but found '%s'", token.getType())); } return token.getValueBuffer(); }
private String parseMapKey(MsgPackToken currentValue) { final DirectBuffer valueBuffer = currentValue.getValueBuffer(); return valueBuffer.getStringWithoutLengthUtf8(0, valueBuffer.capacity()); }
private String parseMapKey(MsgPackToken currentValue) { final DirectBuffer valueBuffer = currentValue.getValueBuffer(); return valueBuffer.getStringWithoutLengthUtf8(0, valueBuffer.capacity()); }
private boolean equals(MsgPackToken x, MsgPackToken y) { if (x.getType() == MsgPackType.NIL || y.getType() == MsgPackType.NIL) { return x.getType() == y.getType(); } else { ensureSameType(x, y); switch (x.getType()) { case STRING: return BufferUtil.equals(x.getValueBuffer(), y.getValueBuffer()); case BOOLEAN: return x.getBooleanValue() == y.getBooleanValue(); case INTEGER: return x.getIntegerValue() == y.getIntegerValue(); case FLOAT: return x.getFloatValue() == y.getFloatValue(); default: throw new JsonConditionException( String.format("Cannot compare value of type: %s", x.getType())); } } }
private boolean equals(MsgPackToken x, MsgPackToken y) { if (x.getType() == MsgPackType.NIL || y.getType() == MsgPackType.NIL) { return x.getType() == y.getType(); } else { ensureSameType(x, y); switch (x.getType()) { case STRING: return BufferUtil.equals(x.getValueBuffer(), y.getValueBuffer()); case BOOLEAN: return x.getBooleanValue() == y.getBooleanValue(); case INTEGER: return x.getIntegerValue() == y.getIntegerValue(); case FLOAT: return x.getFloatValue() == y.getFloatValue(); default: throw new JsonConditionException( String.format("Cannot compare value of type: %s", x.getType())); } } }
BitUtil.SIZE_OF_INT, queryLength, value.getValueBuffer(), 0, value.getValueBuffer().capacity())) { dynamicContext.putInt(0, currentElement + 1);
BitUtil.SIZE_OF_INT, queryLength, value.getValueBuffer(), 0, value.getValueBuffer().capacity())) { dynamicContext.putInt(0, currentElement + 1);
public void setVariablesLocalFromDocument(long scopeKey, DirectBuffer document) { reader.wrap(document, 0, document.capacity()); final int variables = reader.readMapHeader(); for (int i = 0; i < variables; i++) { final MsgPackToken variableName = reader.readToken(); final int nameLength = variableName.getValueBuffer().capacity(); final int nameOffset = reader.getOffset() - nameLength; final int valueOffset = reader.getOffset(); reader.skipValue(); final int valueLength = reader.getOffset() - valueOffset; setVariableLocal( scopeKey, document, nameOffset, nameLength, document, valueOffset, valueLength); } }
public void setVariablesLocalFromDocument(long scopeKey, DirectBuffer document) { reader.wrap(document, 0, document.capacity()); final int variables = reader.readMapHeader(); for (int i = 0; i < variables; i++) { final MsgPackToken variableName = reader.readToken(); final int nameLength = variableName.getValueBuffer().capacity(); final int nameOffset = reader.getOffset() - nameLength; final int valueOffset = reader.getOffset(); reader.skipValue(); final int valueLength = reader.getOffset() - valueOffset; setVariableLocal( scopeKey, document, nameOffset, nameLength, document, valueOffset, valueLength); } }