presto-spi/src/main/java/io/prestosql/spi/block/MethodHandleUtil.java/MethodHandleUtil/nativeValueGetter
class MethodHandleUtil:    public static MethodHandle nativeValueGetter(Type type)
    {
        Class<?> javaType = type.getJavaType();

        MethodHandle methodHandle;
        if (javaType == long.class) {
            methodHandle = GET_LONG;
        }
        else if (javaType == double.class) {
            methodHandle = GET_DOUBLE;
        }
        else if (javaType == boolean.class) {
            methodHandle = GET_BOOLEAN;
        }
        else if (javaType == Slice.class) {
            methodHandle = GET_SLICE;
        }
        else if (javaType == Block.class) {
            methodHandle = GET_BLOCK;
        }
        else {
            throw new IllegalArgumentException("Unknown java type " + javaType + " from type " + type);
        }

        return methodHandle.bindTo(type);
    }