本文整理汇总了Java中org.apache.tinkerpop.gremlin.structure.Graph.Features方法的典型用法代码示例。如果您正苦于以下问题:Java Graph.Features方法的具体用法?Java Graph.Features怎么用?Java Graph.Features使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tinkerpop.gremlin.structure.Graph
的用法示例。
在下文中一共展示了Graph.Features方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: featureString
import org.apache.tinkerpop.gremlin.structure.Graph; //导入方法依赖的package包/类
public static String featureString(final Graph.Features features) {
final StringBuilder sb = new StringBuilder("FEATURES");
final Predicate<Method> supportMethods = (m) -> m.getModifiers() == Modifier.PUBLIC && m.getName().startsWith(featuresStartWith) && !m.getName().equals(featuresStartWith);
sb.append(LINE_SEPARATOR);
Stream.of(Pair.with(Graph.Features.GraphFeatures.class, features.graph()),
Pair.with(Graph.Features.VariableFeatures.class, features.graph().variables()),
Pair.with(Graph.Features.VertexFeatures.class, features.vertex()),
Pair.with(Graph.Features.VertexPropertyFeatures.class, features.vertex().properties()),
Pair.with(Graph.Features.EdgeFeatures.class, features.edge()),
Pair.with(Graph.Features.EdgePropertyFeatures.class, features.edge().properties())).forEach(p -> {
printFeatureTitle(p.getValue0(), sb);
Stream.of(p.getValue0().getMethods())
.filter(supportMethods)
.map(createTransform(p.getValue1()))
.forEach(sb::append);
});
return sb.toString();
}
示例2: create
import org.apache.tinkerpop.gremlin.structure.Graph; //导入方法依赖的package包/类
public static GraphTraversal create(final Class<? extends Element> clazz) {
final Graph mockedGraph = mock(Graph.class);
final Graph.Features features = mock(Graph.Features.class);
final Graph.Features.VertexFeatures vertexFeatures = mock(Graph.Features.VertexFeatures.class);
when(mockedGraph.features()).thenReturn(features);
when(features.vertex()).thenReturn(vertexFeatures);
when(vertexFeatures.getCardinality(any())).thenReturn(VertexProperty.Cardinality.single);
final DefaultGraphTraversal t = new DefaultGraphTraversal<>(mockedGraph);
if (clazz != null) t.asAdmin().addStep(new GraphStep<>(t.asAdmin(), clazz, true));
return t;
}
示例3: features
import org.apache.tinkerpop.gremlin.structure.Graph; //导入方法依赖的package包/类
@Override
public Graph.Features features() {
return bitsyFeatures;
}
示例4: features
import org.apache.tinkerpop.gremlin.structure.Graph; //导入方法依赖的package包/类
@Override
public Graph.Features features() {
return graph.features();
}