如何把long转为ValueWrapper

查询后得到一个Relationship, 把relationship下的属性写入map,如下:

Map<String, ValueWrapper> props = ((Relationship) value).properties()

想把src_vid, dst_vid和rank都添加进去,如下:

props.put(“srcVid”, ((Relationship) cvtedValue).srcId());
props.put(“dstVid”, ((Relationship) cvtedValue).dstId());
props.put(“rank”, ((Relationship) cvtedValue).ranking());

但最后的rank无法加进map里,因为是long类型,有办法将其转化为valuewrapper吗

Long → Value → ValueWrapper

new ValueWrapper(new Value(Value.IVAL, 10L), “utf-8”, 28800))

3 个赞

此话题已在最后回复的 7 天后被自动关闭。不再允许新回复。