当前位置: 首页>>代码示例>>Java>>正文


Java StringFactory类代码示例

本文整理汇总了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());
  }
}
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:26,代码来源:ObjectVertexTest.java

示例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());
  }
}
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:33,代码来源:FactEdgeTest.java

示例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);
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:10,代码来源:TinkerGraphStep.java

示例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);
}
 
开发者ID:rayokota,项目名称:hgraphdb,代码行数:8,代码来源:HBaseVertexStep.java

示例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());
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:8,代码来源:PropertyTest.java

示例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());
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:11,代码来源:EdgeTest.java

示例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());
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:12,代码来源:RepeatStep.java

示例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());
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:16,代码来源:AbstractGremlinProcessTest.java

示例9: toString

import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Override
public String toString() {
  return StringFactory.graphString(this, "");
}
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:5,代码来源:ActGraph.java

示例10: toString

import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Override
public String toString() {
  return StringFactory.propertyString(this);
}
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:5,代码来源:FactProperty.java

示例11: toString

import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Override
public String toString() {
  return StringFactory.vertexString(this);
}
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:5,代码来源:ObjectVertex.java

示例12: toString

import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Override
public String toString() {
  return StringFactory.edgeString(this);
}
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:5,代码来源:FactEdge.java

示例13: testStandardStringRepresentation

import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Test
public void testStandardStringRepresentation() {
  Edge edge = createEdge();
  assertEquals(StringFactory.edgeString(edge), edge.toString());
}
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:6,代码来源:FactEdgeTest.java

示例14: testStandardStringRepresentation

import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Test
public void testStandardStringRepresentation() {
  Vertex vertex = createVertex();
  assertEquals(StringFactory.vertexString(vertex), vertex.toString());
}
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:6,代码来源:ObjectVertexTest.java

示例15: toString

import org.apache.tinkerpop.gremlin.structure.util.StringFactory; //导入依赖的package包/类
@Override
public String toString() {
    return StringFactory.traversalSourceString(this);
}
 
开发者ID:okram,项目名称:mongodb-gremlin,代码行数:5,代码来源:MongoDBTraversalSource.java


注:本文中的org.apache.tinkerpop.gremlin.structure.util.StringFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。