{
int channel = node.getChannel();
if (context instanceof PagePositionContext) {
PagePositionContext pagePositionContext = (PagePositionContext) context;
int position = pagePositionContext.getPosition();
Block block = pagePositionContext.getBlock(channel);
if (block.isNull(position)) {
return null;
}
Class<?> javaType = block.getType().getJavaType();
if (javaType == boolean.class) {
return block.getBoolean(position);
}
else if (javaType == long.class) {
return block.getLong(position);
}
else if (javaType == double.class) {
return block.getDouble(position);
}
else if (javaType == Slice.class) {
return block.getSlice(position);
}
else {
throw new UnsupportedOperationException("not yet implemented");
}
}