Package dev.grafeo.gwp.types
Record Class GqlEdge
java.lang.Object
java.lang.Record
dev.grafeo.gwp.types.GqlEdge
- Record Components:
id- the opaque element identifierlabels- the label setsourceNodeId- the source node ID (directed) or endpoint AtargetNodeId- the target node ID (directed) or endpoint Bundirected- true if this is an undirected edgeproperties- the property map
public record GqlEdge(byte[] id, List<String> labels, byte[] sourceNodeId, byte[] targetNodeId, boolean undirected, Map<String,Object> properties)
extends Record
A property graph edge (directed or undirected).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanCheck if this edge has the given label.byte[]id()Returns the value of theidrecord component.labels()Returns the value of thelabelsrecord component.Returns the value of thepropertiesrecord component.Get a property value by key.byte[]Returns the value of thesourceNodeIdrecord component.byte[]Returns the value of thetargetNodeIdrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of theundirectedrecord component.
-
Constructor Details
-
GqlEdge
public GqlEdge(byte[] id, List<String> labels, byte[] sourceNodeId, byte[] targetNodeId, boolean undirected, Map<String, Object> properties) Creates an instance of aGqlEdgerecord class.- Parameters:
id- the value for theidrecord componentlabels- the value for thelabelsrecord componentsourceNodeId- the value for thesourceNodeIdrecord componenttargetNodeId- the value for thetargetNodeIdrecord componentundirected- the value for theundirectedrecord componentproperties- the value for thepropertiesrecord component
-
-
Method Details
-
hasLabel
Check if this edge has the given label.- Parameters:
label- the label to check- Returns:
- true if the edge has the label
-
property
Get a property value by key.- Parameters:
key- the property key- Returns:
- the property value, or null if not found
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
public byte[] id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
labels
Returns the value of thelabelsrecord component.- Returns:
- the value of the
labelsrecord component
-
sourceNodeId
public byte[] sourceNodeId()Returns the value of thesourceNodeIdrecord component.- Returns:
- the value of the
sourceNodeIdrecord component
-
targetNodeId
public byte[] targetNodeId()Returns the value of thetargetNodeIdrecord component.- Returns:
- the value of the
targetNodeIdrecord component
-
undirected
public boolean undirected()Returns the value of theundirectedrecord component.- Returns:
- the value of the
undirectedrecord component
-
properties
Returns the value of thepropertiesrecord component.- Returns:
- the value of the
propertiesrecord component
-