本文整理汇总了Java中org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo类的典型用法代码示例。如果您正苦于以下问题:Java TypeInfo类的具体用法?Java TypeInfo怎么用?Java TypeInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TypeInfo类属于org.apache.tinkerpop.gremlin.structure.io.graphson包,在下文中一共展示了TypeInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: data
import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo; //导入依赖的package包/类
@Parameterized.Parameters(name = "{0}")
public static Iterable<Object[]> data() {
return Arrays.asList(new Object[][]{
{"graphson-v1", false, false,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V1_0)).reader().create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V1_0)).writer().create()},
{"graphson-v1-embedded", true, true,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V1_0)).reader().mapper(g.io(IoCore.graphson()).mapper().typeInfo(TypeInfo.PARTIAL_TYPES).create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V1_0)).writer().mapper(g.io(IoCore.graphson()).mapper().typeInfo(TypeInfo.PARTIAL_TYPES).create()).create()},
{"graphson-v2", false, false,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V2_0)).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().typeInfo(TypeInfo.NO_TYPES).create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V2_0)).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().typeInfo(TypeInfo.NO_TYPES).create()).create()},
{"graphson-v2-embedded", true, true,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V2_0)).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().typeInfo(TypeInfo.PARTIAL_TYPES).create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V2_0)).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().typeInfo(TypeInfo.PARTIAL_TYPES).create()).create()},
{"graphson-v3", true, true,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V3_0)).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V3_0)).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().create()).create()},
{"gryo-v1", true, true,
(Function<Graph, GraphReader>) g -> g.io(GryoIo.build(GryoVersion.V1_0)).reader().create(),
(Function<Graph, GraphWriter>) g -> g.io(GryoIo.build(GryoVersion.V1_0)).writer().create()},
{"gryo-v3", true, true,
(Function<Graph, GraphReader>) g -> g.io(GryoIo.build(GryoVersion.V3_0)).reader().create(),
(Function<Graph, GraphWriter>) g -> g.io(GryoIo.build(GryoVersion.V3_0)).writer().create()}
});
}
示例2: data
import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo; //导入依赖的package包/类
@Parameterized.Parameters(name = "{0}")
public static Iterable<Object[]> data() {
return Arrays.asList(new Object[][]{
{"graphson-v1", false, false,
(Function<Graph,GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V1_0)).reader().create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V1_0)).writer().create()},
{"graphson-v1-embedded", true, true,
(Function<Graph,GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V1_0)).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().typeInfo(TypeInfo.PARTIAL_TYPES).create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V1_0)).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().typeInfo(TypeInfo.PARTIAL_TYPES).create()).create()},
{"graphson-v2", false, false,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V2_0)).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().typeInfo(TypeInfo.NO_TYPES).create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V2_0)).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().typeInfo(TypeInfo.NO_TYPES).create()).create()},
{"graphson-v2-embedded", true, true,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V2_0)).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().typeInfo(TypeInfo.PARTIAL_TYPES).create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V2_0)).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().typeInfo(TypeInfo.PARTIAL_TYPES).create()).create()},
{"graphson-v3", true, true,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V3_0)).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V3_0)).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().create()).create()},
{"gryo-v1", true, true,
(Function<Graph,GraphReader>) g -> g.io(GryoIo.build(GryoVersion.V1_0)).reader().create(),
(Function<Graph, GraphWriter>) g -> g.io(GryoIo.build(GryoVersion.V1_0)).writer().create()},
{"gryo-v3", true, true,
(Function<Graph,GraphReader>) g -> g.io(GryoIo.build(GryoVersion.V3_0)).reader().create(),
(Function<Graph, GraphWriter>) g -> g.io(GryoIo.build(GryoVersion.V3_0)).writer().create()}
});
}
示例3: data
import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo; //导入依赖的package包/类
@Parameterized.Parameters(name = "{0}")
public static Iterable<Object[]> data() {
final SimpleModule moduleV1d0 = new SimpleModule();
moduleV1d0.addSerializer(CustomId.class, new CustomId.CustomIdJacksonSerializerV1d0());
final SimpleModule moduleV2d0 = new CustomId.CustomIdTinkerPopJacksonModuleV2d0();
final SimpleModule modulev3d0 = new CustomId.CustomIdTinkerPopJacksonModuleV3d0();
return Arrays.asList(new Object[][]{
{"graphson-v1-embedded", true,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V1_0)).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V1_0)).mapper().addCustomModule(moduleV1d0).typeInfo(TypeInfo.PARTIAL_TYPES).create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V1_0)).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V1_0)).mapper().addCustomModule(moduleV1d0).typeInfo(TypeInfo.PARTIAL_TYPES).create()).create()},
{"graphson-v2-embedded", true,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V2_0)).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().addCustomModule(moduleV2d0).typeInfo(TypeInfo.PARTIAL_TYPES).create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V2_0)).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().addCustomModule(moduleV2d0).typeInfo(TypeInfo.PARTIAL_TYPES).create()).create()},
{"graphson-v3", true,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V3_0)).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().addCustomModule(modulev3d0).create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V3_0)).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().addCustomModule(modulev3d0).create()).create()},
{"gryo-v1", true,
(Function<Graph, GraphReader>) g -> g.io(GryoIo.build(GryoVersion.V1_0)).reader().mapper(g.io(GryoIo.build(GryoVersion.V1_0)).mapper().version(GryoVersion.V1_0).addCustom(CustomId.class).create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GryoIo.build(GryoVersion.V1_0)).writer().mapper(g.io(GryoIo.build(GryoVersion.V1_0)).mapper().version(GryoVersion.V1_0).addCustom(CustomId.class).create()).create()},
{"gryo-v3", true,
(Function<Graph, GraphReader>) g -> g.io(GryoIo.build(GryoVersion.V3_0)).reader().mapper(g.io(GryoIo.build(GryoVersion.V3_0)).mapper().version(GryoVersion.V3_0).addCustom(CustomId.class).create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GryoIo.build(GryoVersion.V3_0)).writer().mapper(g.io(GryoIo.build(GryoVersion.V3_0)).mapper().version(GryoVersion.V3_0).addCustom(CustomId.class).create()).create()}
});
}
示例4: shouldWriteNormalizedGraphSON
import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo; //导入依赖的package包/类
/**
* Only need to execute this test with TinkerGraph or other graphs that support user supplied identifiers.
*/
@Test
@FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_STRING_VALUES)
@FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_INTEGER_VALUES)
@FeatureRequirement(featureClass = EdgePropertyFeatures.class, feature = EdgePropertyFeatures.FEATURE_FLOAT_VALUES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_USER_SUPPLIED_IDS)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_NUMERIC_IDS)
@FeatureRequirement(featureClass = Graph.Features.VertexPropertyFeatures.class, feature = Graph.Features.VertexPropertyFeatures.FEATURE_USER_SUPPLIED_IDS)
@FeatureRequirement(featureClass = Graph.Features.VariableFeatures.class, feature = FEATURE_VARIABLES)
@LoadGraphWith(LoadGraphWith.GraphData.CLASSIC)
public void shouldWriteNormalizedGraphSON() throws Exception {
try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
final GraphSONMapper mapper = graph.io(graphson).mapper().version(GraphSONVersion.V2_0).typeInfo(TypeInfo.NO_TYPES).normalize(true).create();
final GraphSONWriter w = graph.io(graphson).writer().mapper(mapper).create();
w.writeGraph(bos, graph);
final String expected = streamToString(IoTest.class.getResourceAsStream(TestHelper.convertPackageToResourcePath(GraphSONResourceAccess.class) + "tinkerpop-classic-normalized-v2d0.json"));
assertEquals(expected.replace("\n", "").replace("\r", ""), bos.toString().replace("\n", "").replace("\r", ""));
}
}
示例5: data
import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo; //导入依赖的package包/类
@Parameterized.Parameters(name = "{0}")
public static Iterable<Object[]> data() {
return Arrays.asList(new Object[][]{
{"graphson-v1", false, false,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V1_0)).reader().create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V1_0)).writer().create()},
{"graphson-v1-embedded", true, false,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V1_0)).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V1_0)).mapper().typeInfo(TypeInfo.PARTIAL_TYPES).create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V1_0)).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V1_0)).mapper().typeInfo(TypeInfo.PARTIAL_TYPES).create()).create()},
{"graphson-v2", false, false,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V2_0)).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().typeInfo(TypeInfo.NO_TYPES).create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V2_0)).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().typeInfo(TypeInfo.NO_TYPES).create()).create()},
{"graphson-v2-embedded", true, false,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V2_0)).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().typeInfo(TypeInfo.PARTIAL_TYPES).create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V2_0)).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().typeInfo(TypeInfo.PARTIAL_TYPES).create()).create()},
{"graphson-v3", true, false,
(Function<Graph, GraphReader>) g -> g.io(GraphSONIo.build(GraphSONVersion.V3_0)).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().create()).create(),
(Function<Graph, GraphWriter>) g -> g.io(GraphSONIo.build(GraphSONVersion.V3_0)).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().create()).create()},
{"gryo-v1", true, true,
(Function<Graph, GraphReader>) g -> g.io(GryoIo.build(GryoVersion.V1_0)).reader().create(),
(Function<Graph, GraphWriter>) g -> g.io(GryoIo.build(GryoVersion.V1_0)).writer().create()},
{"gryo-v3", true, true,
(Function<Graph, GraphReader>) g -> g.io(GryoIo.build(GryoVersion.V3_0)).reader().create(),
(Function<Graph, GraphWriter>) g -> g.io(GryoIo.build(GryoVersion.V3_0)).writer().create()}
});
}
示例6: shouldSerializeTinkerGraphToGraphSONWithTypes
import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo; //导入依赖的package包/类
@Test
public void shouldSerializeTinkerGraphToGraphSONWithTypes() throws Exception {
final TinkerGraph graph = TinkerFactory.createModern();
final Mapper<ObjectMapper> mapper = graph.io(IoCore.graphson()).mapper().typeInfo(TypeInfo.PARTIAL_TYPES).create();
try (final ByteArrayOutputStream out = new ByteArrayOutputStream()) {
final GraphWriter writer = GraphSONWriter.build().mapper(mapper).create();
writer.writeObject(out, graph);
try (final ByteArrayInputStream inputStream = new ByteArrayInputStream(out.toByteArray())) {
final GraphReader reader = GraphSONReader.build().mapper(mapper).create();
final TinkerGraph target = reader.readObject(inputStream, TinkerGraph.class);
IoTest.assertModernGraph(target, true, false);
}
}
}
示例7: shouldWriteClassicGraphAsGraphSONV1d0NoTypes
import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo; //导入依赖的package包/类
/**
* No assertions. Just write out the graph for convenience.
*/
@Test
public void shouldWriteClassicGraphAsGraphSONV1d0NoTypes() throws IOException {
final OutputStream os = new FileOutputStream(tempPath + "tinkerpop-classic-v1d0.json");
GraphSONWriter.build().mapper(GraphSONMapper.build().version(GraphSONVersion.V1_0).typeInfo(TypeInfo.NO_TYPES).create()).create().writeGraph(os, TinkerFactory.createClassic());
os.close();
}
示例8: shouldWriteModernGraphAsGraphSONV1d0NoTypes
import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo; //导入依赖的package包/类
/**
* No assertions. Just write out the graph for convenience.
*/
@Test
public void shouldWriteModernGraphAsGraphSONV1d0NoTypes() throws IOException {
final OutputStream os = new FileOutputStream(tempPath + "tinkerpop-modern-v1d0.json");
GraphSONWriter.build().mapper(GraphSONMapper.build().version(GraphSONVersion.V1_0).typeInfo(TypeInfo.NO_TYPES).create()).create().writeGraph(os, TinkerFactory.createModern());
os.close();
}
示例9: shouldWriteCrewGraphAsGraphSONV1d0NoTypes
import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo; //导入依赖的package包/类
/**
* No assertions. Just write out the graph for convenience.
*/
@Test
public void shouldWriteCrewGraphAsGraphSONV1d0NoTypes() throws IOException {
final OutputStream os = new FileOutputStream(tempPath + "tinkerpop-crew-v1d0.json");
GraphSONWriter.build().mapper(GraphSONMapper.build().version(GraphSONVersion.V1_0).typeInfo(TypeInfo.NO_TYPES).create()).create().writeGraph(os, TinkerFactory.createTheCrew());
os.close();
}
示例10: shouldWriteClassicGraphNormalizedAsGraphSONV1d0
import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo; //导入依赖的package包/类
/**
* No assertions. Just write out the graph for convenience.
*/
@Test
public void shouldWriteClassicGraphNormalizedAsGraphSONV1d0() throws IOException {
final OutputStream os = new FileOutputStream(tempPath + "tinkerpop-classic-normalized-v1d0.json");
GraphSONWriter.build().mapper(GraphSONMapper.build().normalize(true).version(GraphSONVersion.V1_0).typeInfo(TypeInfo.NO_TYPES).create()).create().writeGraph(os, TinkerFactory.createClassic());
os.close();
}
示例11: shouldWriteModernGraphNormalizedAsGraphSONV1d0
import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo; //导入依赖的package包/类
/**
* No assertions. Just write out the graph for convenience.
*/
@Test
public void shouldWriteModernGraphNormalizedAsGraphSONV1d0() throws IOException {
final OutputStream os = new FileOutputStream(tempPath + "tinkerpop-modern-normalized-v1d0.json");
GraphSONWriter.build().mapper(GraphSONMapper.build().normalize(true).version(GraphSONVersion.V1_0).typeInfo(TypeInfo.NO_TYPES).create()).create().writeGraph(os, TinkerFactory.createModern());
os.close();
}
示例12: shouldWriteClassicGraphAsGraphSONV1d0WithTypes
import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo; //导入依赖的package包/类
/**
* No assertions. Just write out the graph for convenience.
*/
@Test
public void shouldWriteClassicGraphAsGraphSONV1d0WithTypes() throws IOException {
final OutputStream os = new FileOutputStream(tempPath + "tinkerpop-classic-typed-v1d0.json");
GraphSONWriter.build().mapper(GraphSONMapper.build().version(GraphSONVersion.V1_0).typeInfo(TypeInfo.PARTIAL_TYPES).create())
.create().writeGraph(os, TinkerFactory.createClassic());
os.close();
}
示例13: shouldWriteModernGraphAsGraphSONV1d0WithTypes
import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo; //导入依赖的package包/类
/**
* No assertions. Just write out the graph for convenience.
*/
@Test
public void shouldWriteModernGraphAsGraphSONV1d0WithTypes() throws IOException {
final OutputStream os = new FileOutputStream(tempPath + "tinkerpop-modern-typed-v1d0.json");
GraphSONWriter.build().mapper(GraphSONMapper.build().version(GraphSONVersion.V1_0).typeInfo(TypeInfo.PARTIAL_TYPES).create())
.create().writeGraph(os, TinkerFactory.createModern());
os.close();
}
示例14: shouldWriteCrewGraphAsGraphSONV1d0WithTypes
import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo; //导入依赖的package包/类
/**
* No assertions. Just write out the graph for convenience.
*/
@Test
public void shouldWriteCrewGraphAsGraphSONV1d0WithTypes() throws IOException {
final OutputStream os = new FileOutputStream(tempPath + "tinkerpop-crew-typed-v1d0.json");
GraphSONWriter.build().mapper(GraphSONMapper.build().version(GraphSONVersion.V1_0).typeInfo(TypeInfo.PARTIAL_TYPES).create())
.create().writeGraph(os, TinkerFactory.createTheCrew());
os.close();
}
示例15: shouldWriteClassicGraphAsGraphSONV2d0NoTypes
import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo; //导入依赖的package包/类
/**
* No assertions. Just write out the graph for convenience.
*/
@Test
public void shouldWriteClassicGraphAsGraphSONV2d0NoTypes() throws IOException {
final OutputStream os = new FileOutputStream(tempPath + "tinkerpop-classic-v2d0.json");
GraphSONWriter.build().mapper(GraphSONMapper.build().version(GraphSONVersion.V2_0).typeInfo(TypeInfo.NO_TYPES).create()).create()
.writeGraph(os, TinkerFactory.createClassic());
os.close();
}