本文整理汇总了Java中org.apache.tinkerpop.gremlin.structure.io.Io.Builder类的典型用法代码示例。如果您正苦于以下问题:Java Builder类的具体用法?Java Builder怎么用?Java Builder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Builder类属于org.apache.tinkerpop.gremlin.structure.io.Io包,在下文中一共展示了Builder类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: persistModel
import org.apache.tinkerpop.gremlin.structure.io.Io.Builder; //导入依赖的package包/类
@Override
public void persistModel() throws IOException, XMLStreamException, ClassNotFoundException, IllegalAccessException,
InstantiationException {
final TinkerGraphFormat format = gc.getGraphFormat();
Builder<?> builder = null;
switch (format) {
case GRAPHML:
builder = IoCore.graphml();
break;
case GRAPHSON:
builder = IoCore.graphson();
break;
case GRYO:
builder = IoCore.gryo();
break;
default:
throw new UnsupportedOperationException("Format " + format + " is not supported.");
}
final String postfix = "-tinkerpop." + format.toString().toLowerCase();
final String fileName = gc.getConfigBase().getModelPathWithoutExtension() + postfix;
graph.io(builder).writeGraph(fileName);
graph.close();
}
示例2: io
import org.apache.tinkerpop.gremlin.structure.io.Io.Builder; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public <I extends Io> I io(Builder<I> builder) {
return (I) Graph.super.io(builder.onMapper(mb -> mb.addRegistry(OrientIoRegistry.getInstance())));
}