• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Property类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.tinkerpop.gremlin.structure.Property的典型用法代码示例。如果您正苦于以下问题:Java Property类的具体用法?Java Property怎么用?Java Property使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Property类属于org.apache.tinkerpop.gremlin.structure包,在下文中一共展示了Property类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: shouldSerializeEdgeProperty

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
@Test
public void shouldSerializeEdgeProperty() throws Exception {
    final Graph g = TinkerGraph.open();
    final Vertex v1 = g.addVertex();
    final Vertex v2 = g.addVertex();
    final Edge e = v1.addEdge("test", v2);
    e.property("abc", 123);

    final Iterable<Property<Object>> iterable = IteratorUtils.list(e.properties("abc"));
    final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(iterable).create());

    final JsonNode json = mapper.readTree(results);

    assertNotNull(json);
    assertEquals(msg.getRequestId().toString(), json.get(SerTokens.TOKEN_REQUEST).asText());
    final JsonNode converted = json.get(SerTokens.TOKEN_RESULT).get(SerTokens.TOKEN_DATA);

    assertNotNull(converted);
    assertEquals(1, converted.size());

    final JsonNode propertyAsJson = converted.get(0);
    assertNotNull(propertyAsJson);

    assertEquals(123, propertyAsJson.get("value").asInt());
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:26,代码来源:GraphSONMessageSerializerV1d0Test.java


示例2: shouldSerializeEdgeProperty

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
@Test
public void shouldSerializeEdgeProperty() throws Exception {
    final Graph graph = TinkerGraph.open();
    final Vertex v1 = graph.addVertex();
    final Vertex v2 = graph.addVertex();
    final Edge e = v1.addEdge("test", v2);
    e.property("abc", 123);

    final Iterable<Property<Object>> iterable = IteratorUtils.list(e.properties("abc"));
    final ResponseMessage response = convert(iterable);
    assertCommon(response);

    final List<Map<String, Object>> propertyList = (List<Map<String, Object>>) response.getResult().getData();
    assertEquals(1, propertyList.size());
    assertEquals(123, propertyList.get(0).get("value"));
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:17,代码来源:GraphSONMessageSerializerGremlinV1d0Test.java


示例3: find

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
/**
 * Find the given element using it's id, if it has one, or all of it's properties.
 */
protected <E extends Element> GraphTraversal find(E element) {
  GraphTraversal traversal = g.V();
  if (element.id() != null) {
    traversal = traversal.hasId(element.id());
  } else {
    traversal = traversal.hasLabel(element.label());
    Object[] properties = Properties.id(element);
    if (properties == null || properties.length == 0) {
      properties = Properties.all(element);
    }
    for (Property property : list(properties)) {
      traversal = traversal.has(property.key(), property.value());
    }
  }
  return traversal;
}
 
开发者ID:karthicks,项目名称:gremlin-ogm,代码行数:20,代码来源:ElementGraph.java


示例4: createKeyIndex

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
public void createKeyIndex(final String key) {
    if (null == key)
        throw Graph.Exceptions.argumentCanNotBeNull("key");
    if (key.isEmpty())
        throw new IllegalArgumentException("The key for the index cannot be an empty string");

    if (this.indexedKeys.contains(key))
        return;
    this.indexedKeys.add(key);

    (Vertex.class.isAssignableFrom(this.indexClass) ?
            this.graph.vertices.values().<T>stream() :
            this.graph.edges.values().<T>stream())
            .map(e -> new Object[]{((T) e).property(key), e})
            .filter(a -> ((Property) a[0]).isPresent())
            .forEach(a -> this.put(key, ((Property) a[0]).value(), (T) a[1]));
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:18,代码来源:TinkerIndex.java


示例5: properties

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
@Override
// THERE ARE TWO MORE COPIES OF THIS CODE IN ELEMENT AND VERTEX
public <T> Iterator<Property<T>> properties(String... propertyKeys) {
    ArrayList<Property<T>> ans = new ArrayList<Property<T>>();

    if (propertyKeys.length == 0) {
    	if (this.properties == null) return Collections.emptyIterator();
    	propertyKeys = this.properties.getPropertyKeys();
    }

    for (String key : propertyKeys) {
        Property<T> prop = property(key);
        if (prop.isPresent()) ans.add(prop);
    }
    return ans.iterator();
}
 
开发者ID:lambdazen,项目名称:bitsy,代码行数:17,代码来源:BitsyEdge.java


示例6: givenEdgeWithPropertyValueShouldShouldGetPropertyValue

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
@Test
public void givenEdgeWithPropertyValueShouldShouldGetPropertyValue() {
    // arrange
    Mockito.when(graph.tx()).thenAnswer(invocation -> transaction);
    Mockito.when(relationship.get(Mockito.eq("id"))).thenAnswer(invocation -> Values.value(1L));
    Mockito.when(relationship.type()).thenAnswer(invocation -> "label");
    Mockito.when(relationship.keys()).thenAnswer(invocation -> Collections.singleton("key1"));
    Mockito.when(relationship.get(Mockito.eq("key1"))).thenAnswer(invocation -> Values.value("value1"));
    Mockito.when(provider.fieldName()).thenAnswer(invocation -> "id");
    ArgumentCaptor<Long> argument = ArgumentCaptor.forClass(Long.class);
    Mockito.when(provider.processIdentifier(argument.capture())).thenAnswer(invocation -> argument.getValue());
    Neo4JEdge edge = new Neo4JEdge(graph, session, provider, outVertex, relationship, inVertex);
    edge.property("p1", 1L);
    // act
    Property<?> result = edge.property("p1");
    // assert
    Assert.assertNotNull("Failed to get property value", result);
    Assert.assertTrue("Property value is not present", result.isPresent());
    Assert.assertEquals("Invalid property key", result.key(), "p1");
    Assert.assertEquals("Invalid property value", result.value(), 1L);
    Assert.assertEquals("Invalid property element", result.element(), edge);
}
 
开发者ID:SteelBridgeLabs,项目名称:neo4j-gremlin-bolt,代码行数:23,代码来源:Neo4JEdgeWhileGettingPropertyValueTest.java


示例7: shouldDeterminePropertiesAreNotEqualWhenKeysAreDifferent

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
@Test
public void shouldDeterminePropertiesAreNotEqualWhenKeysAreDifferent() {
    final Property mockPropertyA = mock(Property.class);
    final Property mockPropertyB = mock(Property.class);
    final Element mockElement = mock(Element.class);
    when(mockPropertyA.isPresent()).thenReturn(true);
    when(mockPropertyB.isPresent()).thenReturn(true);
    when(mockPropertyA.element()).thenReturn(mockElement);
    when(mockPropertyB.element()).thenReturn(mockElement);
    when(mockPropertyA.key()).thenReturn("k");
    when(mockPropertyB.key()).thenReturn("k1");
    when(mockPropertyA.value()).thenReturn("v");
    when(mockPropertyB.value()).thenReturn("v");

    assertFalse(ElementHelper.areEqual(mockPropertyA, mockPropertyB));
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:17,代码来源:ElementHelperTest.java


示例8: areEqual

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
/**
 * A standard method for determining if two {@link org.apache.tinkerpop.gremlin.structure.Property} objects are equal. This method should be used by any
 * {@link Object#equals(Object)} implementation to ensure consistent behavior.
 *
 * @param a the first {@link org.apache.tinkerpop.gremlin.structure.Property}
 * @param b the second {@link org.apache.tinkerpop.gremlin.structure.Property}
 * @return true if equal and false otherwise
 */
public static boolean areEqual(final Property a, final Object b) {
    if (null == a)
        throw Graph.Exceptions.argumentCanNotBeNull("a");
    if (null == b)
        throw Graph.Exceptions.argumentCanNotBeNull("b");

    if (a == b)
        return true;
    if (!(b instanceof Property))
        return false;
    if (!a.isPresent() && !((Property) b).isPresent())
        return true;
    if (!a.isPresent() && ((Property) b).isPresent() || a.isPresent() && !((Property) b).isPresent())
        return false;
    return a.key().equals(((Property) b).key()) && a.value().equals(((Property) b).value()) && areEqual(a.element(), ((Property) b).element());

}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:26,代码来源:ElementHelper.java


示例9: DetachedVertexProperty

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
protected DetachedVertexProperty(final VertexProperty<V> vertexProperty, final boolean withProperties) {
    super(vertexProperty);
    this.value = vertexProperty.value();
    this.vertex = DetachedFactory.detach(vertexProperty.element(), false);

    // only serialize properties if requested, the graph supports it and there are meta properties present.
    // this prevents unnecessary object creation of a new HashMap which will just be empty.  it will use
    // Collections.emptyMap() by default
    if (withProperties && vertexProperty.graph().features().vertex().supportsMetaProperties()) {
        final Iterator<Property<Object>> propertyIterator = vertexProperty.properties();
        if (propertyIterator.hasNext()) {
            this.properties = new HashMap<>();
            propertyIterator.forEachRemaining(property -> this.properties.put(property.key(), Collections.singletonList(DetachedFactory.detach(property))));
        }
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:17,代码来源:DetachedVertexProperty.java


示例10: shouldAttachWithGetMethod

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
@Test
@LoadGraphWith(LoadGraphWith.GraphData.CREW)
public void shouldAttachWithGetMethod() {
    // vertex host
    g.V().forEachRemaining(vertex -> TestHelper.validateEquality(vertex, StarGraph.of(vertex).getStarVertex().attach(Attachable.Method.get(vertex))));
    g.V().forEachRemaining(vertex -> StarGraph.of(vertex).getStarVertex().properties().forEachRemaining(vertexProperty -> TestHelper.validateEquality(vertexProperty, ((Attachable<VertexProperty>) vertexProperty).attach(Attachable.Method.get(vertex)))));
    g.V().forEachRemaining(vertex -> StarGraph.of(vertex).getStarVertex().properties().forEachRemaining(vertexProperty -> vertexProperty.properties().forEachRemaining(property -> TestHelper.validateEquality(property, ((Attachable<Property>) property).attach(Attachable.Method.get(vertex))))));
    g.V().forEachRemaining(vertex -> StarGraph.of(vertex).getStarVertex().edges(Direction.OUT).forEachRemaining(edge -> TestHelper.validateEquality(edge, ((Attachable<Edge>) edge).attach(Attachable.Method.get(vertex)))));
    g.V().forEachRemaining(vertex -> StarGraph.of(vertex).getStarVertex().edges(Direction.OUT).forEachRemaining(edge -> edge.properties().forEachRemaining(property -> TestHelper.validateEquality(property, ((Attachable<Property>) property).attach(Attachable.Method.get(vertex))))));

    // graph host
    g.V().forEachRemaining(vertex -> TestHelper.validateEquality(vertex, StarGraph.of(vertex).getStarVertex().attach(Attachable.Method.get(graph))));
    g.V().forEachRemaining(vertex -> StarGraph.of(vertex).getStarVertex().properties().forEachRemaining(vertexProperty -> TestHelper.validateEquality(vertexProperty, ((Attachable<VertexProperty>) vertexProperty).attach(Attachable.Method.get(graph)))));
    g.V().forEachRemaining(vertex -> StarGraph.of(vertex).getStarVertex().properties().forEachRemaining(vertexProperty -> vertexProperty.properties().forEachRemaining(property -> TestHelper.validateEquality(property, ((Attachable<Property>) property).attach(Attachable.Method.get(graph))))));
    g.V().forEachRemaining(vertex -> StarGraph.of(vertex).getStarVertex().edges(Direction.OUT).forEachRemaining(edge -> TestHelper.validateEquality(edge, ((Attachable<Edge>) edge).attach(Attachable.Method.get(graph)))));
    g.V().forEachRemaining(vertex -> StarGraph.of(vertex).getStarVertex().edges(Direction.OUT).forEachRemaining(edge -> edge.properties().forEachRemaining(property -> TestHelper.validateEquality(property, ((Attachable<Property>) property).attach(Attachable.Method.get(graph))))));
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:18,代码来源:StarGraphTest.java


示例11: DetachedEdge

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
protected DetachedEdge(final Edge edge, final boolean withProperties) {
    super(edge);
    this.outVertex = DetachedFactory.detach(edge.outVertex(), false);
    this.inVertex = DetachedFactory.detach(edge.inVertex(), false);

    // only serialize properties if requested, the graph supports it and there are meta properties present.
    // this prevents unnecessary object creation of a new HashMap of a new HashMap which will just be empty.
    // it will use Collections.emptyMap() by default
    if (withProperties) {
        final Iterator<Property<Object>> propertyIterator = edge.properties();
        if (propertyIterator.hasNext()) {
            this.properties = new HashMap<>();
            propertyIterator.forEachRemaining(property -> this.properties.put(property.key(), Collections.singletonList(DetachedFactory.detach(property))));
        }
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:17,代码来源:DetachedEdge.java


示例12: DetachedPath

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
protected DetachedPath(final Path path, final boolean withProperties) {
    path.forEach((object, labels) -> {
        if (object instanceof DetachedElement || object instanceof DetachedProperty || object instanceof DetachedPath) {
            this.objects.add(object);
            this.labels.add(labels);
        } else if (object instanceof Element) {
            this.objects.add(DetachedFactory.detach((Element) object, withProperties));
            this.labels.add(labels);
        } else if (object instanceof Property) {
            this.objects.add(DetachedFactory.detach((Property) object));
            this.labels.add(labels);
        } else if (object instanceof Path) {
            this.objects.add(DetachedFactory.detach((Path) object, withProperties));
            this.labels.add(labels);
        } else {
            this.objects.add(object);
            this.labels.add(labels);
        }
    });
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:21,代码来源:DetachedPath.java


示例13: create

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
public static <V> Function<Attachable<V>, V> create(final Host hostVertexOrGraph) {
    return (Attachable<V> attachable) -> {
        final Object base = attachable.get();
        if (base instanceof Vertex) {
            return hostVertexOrGraph instanceof Graph ?
                    (V) Method.createVertex((Attachable<Vertex>) attachable, (Graph) hostVertexOrGraph) :
                    (V) Method.createVertex((Attachable<Vertex>) attachable, (Vertex) hostVertexOrGraph);
        } else if (base instanceof Edge) {
            return hostVertexOrGraph instanceof Graph ?
                    (V) Method.createEdge((Attachable<Edge>) attachable, (Graph) hostVertexOrGraph) :
                    (V) Method.createEdge((Attachable<Edge>) attachable, (Vertex) hostVertexOrGraph);
        } else if (base instanceof VertexProperty) {
            return hostVertexOrGraph instanceof Graph ?
                    (V) Method.createVertexProperty((Attachable<VertexProperty>) attachable, (Graph) hostVertexOrGraph) :
                    (V) Method.createVertexProperty((Attachable<VertexProperty>) attachable, (Vertex) hostVertexOrGraph);
        } else if (base instanceof Property) {
            return hostVertexOrGraph instanceof Graph ?
                    (V) Method.createProperty((Attachable<Property>) attachable, (Graph) hostVertexOrGraph) :
                    (V) Method.createProperty((Attachable<Property>) attachable, (Vertex) hostVertexOrGraph);
        } else
            throw Attachable.Exceptions.providedAttachableMustContainAGraphObject(attachable);
    };
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:24,代码来源:Attachable.java


示例14: createProperty

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
public static Property createProperty(final Attachable<Property> attachableProperty, final Graph hostGraph) {
    final Property baseProperty = attachableProperty.get();
    final Element baseElement = baseProperty.element();
    if (baseElement instanceof Vertex) {
        return Method.createVertexProperty((Attachable) attachableProperty, hostGraph);
    } else if (baseElement instanceof Edge) {
        final Iterator<Edge> edgeIterator = hostGraph.edges(baseElement.id());
        if (edgeIterator.hasNext())
            return edgeIterator.next().property(baseProperty.key(), baseProperty.value());
        throw new IllegalStateException("Could not find edge to create the attachable property on");
    } else { // vertex property
        final Iterator<Vertex> vertexIterator = hostGraph.vertices(((VertexProperty) baseElement).element().id());
        if (vertexIterator.hasNext()) {
            final Vertex vertex = vertexIterator.next();
            final Iterator<VertexProperty<Object>> vertexPropertyIterator = vertex.properties(((VertexProperty) baseElement).key());
            while (vertexPropertyIterator.hasNext()) {
                final VertexProperty<Object> vp = vertexPropertyIterator.next();
                if (ElementHelper.areEqual(vp, baseElement))
                    return vp.property(baseProperty.key(), baseProperty.value());
            }
        }
        throw new IllegalStateException("Could not find vertex property to create the attachable property on");
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:25,代码来源:Attachable.java


示例15: givenPropertyValueShouldAddItToEdge

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
@Test
public void givenPropertyValueShouldAddItToEdge() {
    // arrange
    Mockito.when(graph.tx()).thenAnswer(invocation -> transaction);
    Mockito.when(relationship.get(Mockito.eq("id"))).thenAnswer(invocation -> Values.value(1L));
    Mockito.when(relationship.type()).thenAnswer(invocation -> "label");
    Mockito.when(relationship.keys()).thenAnswer(invocation -> Collections.singleton("key1"));
    Mockito.when(relationship.get(Mockito.eq("key1"))).thenAnswer(invocation -> Values.value("value1"));
    Mockito.when(provider.fieldName()).thenAnswer(invocation -> "id");
    ArgumentCaptor<Long> argument = ArgumentCaptor.forClass(Long.class);
    Mockito.when(provider.processIdentifier(argument.capture())).thenAnswer(invocation -> argument.getValue());
    Neo4JEdge edge = new Neo4JEdge(graph, session, provider, outVertex, relationship, inVertex);
    Property<?> result = edge.property("p1", 1L);
    // act
    result.remove();
    // assert
    Assert.assertFalse("Failed to remove property from edge", edge.property("p1").isPresent());
}
 
开发者ID:SteelBridgeLabs,项目名称:neo4j-gremlin-bolt,代码行数:19,代码来源:Neo4JEdgeWhileRemovingPropertyValueTest.java


示例16: ReferencePath

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
protected ReferencePath(final Path path) {
    path.forEach((object, labels) -> {
        if (object instanceof ReferenceElement || object instanceof ReferenceProperty || object instanceof ReferencePath) {
            this.objects.add(object);
            this.labels.add(new HashSet<>(labels));
        } else if (object instanceof Element) {
            this.objects.add(ReferenceFactory.detach((Element) object));
            this.labels.add(new HashSet<>(labels));
        } else if (object instanceof Property) {
            this.objects.add(ReferenceFactory.detach((Property) object));
            this.labels.add(new HashSet<>(labels));
        } else if (object instanceof Path) {
            this.objects.add(ReferenceFactory.detach((Path) object));
            this.labels.add(new HashSet<>(labels));
        } else {
            this.objects.add(object);
            this.labels.add(new HashSet<>(labels));
        }
    });
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:21,代码来源:ReferencePath.java


示例17: givenNoKeysShouldShouldGetAllProperties

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
@Test
public void givenNoKeysShouldShouldGetAllProperties() {
    // arrange
    Mockito.when(graph.tx()).thenAnswer(invocation -> transaction);
    Mockito.when(relationship.get(Mockito.eq("id"))).thenAnswer(invocation -> Values.value(1L));
    Mockito.when(relationship.type()).thenAnswer(invocation -> "label");
    Mockito.when(relationship.keys()).thenAnswer(invocation -> new ArrayList<>());
    Mockito.when(provider.fieldName()).thenAnswer(invocation -> "id");
    ArgumentCaptor<Long> argument = ArgumentCaptor.forClass(Long.class);
    Mockito.when(provider.processIdentifier(argument.capture())).thenAnswer(invocation -> argument.getValue());
    Neo4JEdge edge = new Neo4JEdge(graph, session, provider, outVertex, relationship, inVertex);
    edge.property("p1", 1L);
    edge.property("p2", 1L);
    // act
    Iterator<Property<Long>> result = edge.properties();
    // assert
    Assert.assertNotNull("Failed to get properties", result);
    Assert.assertTrue("Property is not present", result.hasNext());
    result.next();
    Assert.assertTrue("Property is not present", result.hasNext());
    result.next();
    Assert.assertFalse("Too many properties in edge", result.hasNext());
}
 
开发者ID:SteelBridgeLabs,项目名称:neo4j-gremlin-bolt,代码行数:24,代码来源:Neo4JEdgeWhileGettingPropertiesTest.java


示例18: getOrCreateEdge

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Edge getOrCreateEdge(final Edge edge, final Vertex outVertex, final Vertex inVertex, final Graph graph, final GraphTraversalSource g) {
    final Edge e;
    final Traversal<Vertex, Edge> t = g.V(outVertex).outE(edge.label()).filter(__.inV().is(inVertex));
    if (t.hasNext()) {
        e = t.next();
        edge.properties().forEachRemaining(property -> {
            final Property<?> existing = e.property(property.key());
            if (!existing.isPresent() || !existing.value().equals(property.value())) {
                e.property(property.key(), property.value());
            }
        });
    } else {
        e = createEdge(edge, outVertex, inVertex, graph, g);
    }
    return e;
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:21,代码来源:IncrementalBulkLoader.java


示例19: testGetPropertyKeysOnEdge

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的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


示例20: list

import org.apache.tinkerpop.gremlin.structure.Property; //导入依赖的package包/类
/**
 * Convert the key value array into a list of {@link Property}s.
 */
public static List<Property> list(Object... objects) {
  List<Property> properties = new ArrayList<>();
  for (int i = 0; i < objects.length; i = i + 2) {
    String key = (String) objects[i];
    Object value = objects[i + 1];
    properties.add(new DetachedProperty<>(key, value));
  }
  return properties;
}
 
开发者ID:karthicks,项目名称:gremlin-ogm,代码行数:13,代码来源:Properties.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Any类代码示例发布时间:2022-05-21
下一篇:
Java Row7类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap