本文整理汇总了Java中org.apache.tinkerpop.gremlin.structure.util.StringFactory类的典型用法代码示例。如果您正苦于以下问题:Java StringFactory类的具体用法?Java StringFactory怎么用?Java StringFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StringFactory类属于org.apache.tinkerpop.gremlin.structure.util包,在下文中一共展示了StringFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetPropertyKeysOnVertex
import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Test
public void testGetPropertyKeysOnVertex() {
Vertex vertex = createVertex();
// Test that the following properties exists on the vertex.
Map<String, String> expected = MapUtils.map(
T("value", "value")
);
Set<String> keys = vertex.keys();
Set<VertexProperty<Object>> properties = SetUtils.set(vertex.properties());
assertEquals(expected.size(), keys.size());
assertEquals(expected.size(), properties.size());
for (Map.Entry<String, String> entry : expected.entrySet()) {
assertTrue(keys.contains(entry.getKey()));
VertexProperty<Object> property = vertex.property(entry.getKey());
assertNotNull(property.id());
assertEquals(entry.getValue(), property.value());
assertEquals(property.key(), property.label());
assertEquals(StringFactory.propertyString(property), property.toString());
assertSame(vertex, property.element());
}
}
示例2: testGetPropertyKeysOnEdge
import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Test
public void testGetPropertyKeysOnEdge() {
UUID factID = mockFact(null);
Edge edge = new FactEdge(getActGraph(), factID, mockObject(), mockObject());
// Test that the following properties exists on the edge.
Map<String, Object> expected = MapUtils.map(
T("factID", factID),
T("value", "value"),
T("inReferenceToID", UUID.fromString("00000000-0000-0000-0000-000000000001")),
T("organizationID", UUID.fromString("00000000-0000-0000-0000-000000000002")),
T("sourceID", UUID.fromString("00000000-0000-0000-0000-000000000003")),
T("accessMode", AccessMode.Public),
T("timestamp", 123456789L),
T("lastSeenTimestamp", 987654321L)
);
Set<String> keys = edge.keys();
Set<Property<Object>> properties = SetUtils.set(edge.properties());
assertEquals(expected.size(), keys.size());
assertEquals(expected.size(), properties.size());
for (Map.Entry<String, Object> entry : expected.entrySet()) {
assertTrue(keys.contains(entry.getKey()));
Property<Object> property = edge.property(entry.getKey());
assertEquals(entry.getValue(), property.value());
assertEquals(StringFactory.propertyString(property), property.toString());
assertSame(edge, property.element());
}
}
示例3: toString
import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Override
public String toString() {
if (this.hasContainers.isEmpty())
return super.toString();
else
return 0 == this.ids.length ?
StringFactory.stepString(this, this.returnClass.getSimpleName().toLowerCase(), this.hasContainers) :
StringFactory.stepString(this, this.returnClass.getSimpleName().toLowerCase(), Arrays.toString(this.ids), this.hasContainers);
}
示例4: toString
import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Override
public String toString() {
if (this.hasContainers.isEmpty())
return super.toString();
else
return StringFactory.stepString(this, getDirection(), Arrays.asList(getEdgeLabels()), getReturnClass().getSimpleName().toLowerCase(), this.hasContainers);
}
示例5: shouldHaveStandardStringRepresentation
import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldHaveStandardStringRepresentation() {
final Vertex v = graph.addVertex("name", "marko");
final Property p = v.property("name");
assertEquals(StringFactory.propertyString(p), p.toString());
}
示例6: shouldHaveStandardStringRepresentation
import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Test
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
public void shouldHaveStandardStringRepresentation() {
final Vertex v1 = graph.addVertex();
final Vertex v2 = graph.addVertex();
final Edge e = v1.addEdge("friends", v2);
assertEquals(StringFactory.edgeString(e), e.toString());
}
示例7: toString
import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Override
public String toString() {
if (this.untilFirst && this.emitFirst)
return StringFactory.stepString(this, untilString(), emitString(), this.repeatTraversal);
else if (this.emitFirst)
return StringFactory.stepString(this, emitString(), this.repeatTraversal, untilString());
else if (this.untilFirst)
return StringFactory.stepString(this, untilString(), this.repeatTraversal, emitString());
else
return StringFactory.stepString(this, this.repeatTraversal, untilString(), emitString());
}
示例8: checkSideEffects
import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
public static void checkSideEffects(final TraversalSideEffects sideEffects, final Object... keysClasses) {
int counter = 0;
for (int i = 0; i < keysClasses.length; i = i + 2) {
counter++;
final String key = (String) keysClasses[i];
final Class clazz = (Class) keysClasses[i + 1];
assertTrue(sideEffects.keys().contains(key));
assertTrue(sideEffects.exists(key));
assertEquals(clazz, sideEffects.get((String) keysClasses[i]).getClass());
assertFalse(sideEffects.exists(UUID.randomUUID().toString()));
}
assertEquals(sideEffects.keys().size(), counter);
assertFalse(sideEffects.keys().contains(UUID.randomUUID().toString()));
assertEquals(StringFactory.traversalSideEffectsString(sideEffects), sideEffects.toString());
}
示例9: toString
import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Override
public String toString() {
return StringFactory.graphString(this, "");
}
示例10: toString
import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Override
public String toString() {
return StringFactory.propertyString(this);
}
示例11: toString
import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Override
public String toString() {
return StringFactory.vertexString(this);
}
示例12: toString
import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Override
public String toString() {
return StringFactory.edgeString(this);
}
示例13: testStandardStringRepresentation
import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Test
public void testStandardStringRepresentation() {
Edge edge = createEdge();
assertEquals(StringFactory.edgeString(edge), edge.toString());
}
示例14: testStandardStringRepresentation
import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Test
public void testStandardStringRepresentation() {
Vertex vertex = createVertex();
assertEquals(StringFactory.vertexString(vertex), vertex.toString());
}
示例15: toString
import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Override
public String toString() {
return StringFactory.traversalSourceString(this);
}