private bool HasProperty(PropertyCursor propertyCursor, int property) { while (propertyCursor.Next()) { if (propertyCursor.PropertyKey() == property) { return(true); } } return(false); }
/// <summary> /// Fetches a given property from a node /// </summary> /// <param name="read"> The current Read instance </param> /// <param name="nodeCursor"> The node cursor to use </param> /// <param name="node"> The id of the node </param> /// <param name="propertyCursor"> The property cursor to use </param> /// <param name="prop"> The id of the property to find </param> /// <returns> The value of the given property </returns> /// <exception cref="EntityNotFoundException"> If the node cannot be find. </exception> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public static org.neo4j.values.storable.Value nodeGetProperty(org.neo4j.internal.kernel.api.Read read, org.neo4j.internal.kernel.api.NodeCursor nodeCursor, long node, org.neo4j.internal.kernel.api.PropertyCursor propertyCursor, int prop) throws org.neo4j.internal.kernel.api.exceptions.EntityNotFoundException public static Value NodeGetProperty(Read read, NodeCursor nodeCursor, long node, PropertyCursor propertyCursor, int prop) { if (prop == StatementConstants.NO_SUCH_PROPERTY_KEY) { return(Values.NO_VALUE); } SingleNode(read, nodeCursor, node); nodeCursor.Properties(propertyCursor); while (propertyCursor.Next()) { if (propertyCursor.PropertyKey() == prop) { return(propertyCursor.PropertyValue()); } } return(Values.NO_VALUE); }
/// <summary> /// Fetches a given property from a relationship /// </summary> /// <param name="read"> The current Read instance </param> /// <param name="relationship"> The node cursor to use </param> /// <param name="node"> The id of the node </param> /// <param name="propertyCursor"> The property cursor to use </param> /// <param name="prop"> The id of the property to find </param> /// <returns> The value of the given property </returns> /// <exception cref="EntityNotFoundException"> If the node cannot be find. </exception> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public static org.neo4j.values.storable.Value relationshipGetProperty(org.neo4j.internal.kernel.api.Read read, org.neo4j.internal.kernel.api.RelationshipScanCursor relationship, long node, org.neo4j.internal.kernel.api.PropertyCursor propertyCursor, int prop) throws org.neo4j.internal.kernel.api.exceptions.EntityNotFoundException public static Value RelationshipGetProperty(Read read, RelationshipScanCursor relationship, long node, PropertyCursor propertyCursor, int prop) { if (prop == StatementConstants.NO_SUCH_PROPERTY_KEY) { return(Values.NO_VALUE); } SingleRelationship(read, relationship, node); relationship.Properties(propertyCursor); while (propertyCursor.Next()) { if (propertyCursor.PropertyKey() == prop) { return(propertyCursor.PropertyValue()); } } return(Values.NO_VALUE); }