Package hydra.pg.model
Class Vertex<V>
- java.lang.Object
-
- hydra.pg.model.Vertex<V>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Vertex<V>>
public class Vertex<V> extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<Vertex<V>>
A vertex- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVertex.Builder<V>A fluent builder forVertex.
-
Field Summary
Fields Modifier and Type Field Description VidThe unique identifier of the vertexstatic NameIDName of thehydra.pg.model.Vertex.idfield.VertexLabellabelThe label of the vertexstatic NameLABELName of thehydra.pg.model.Vertex.labelfield.java.util.Map<PropertyKey,V>propertiesA key/value map of vertex propertiesstatic NamePROPERTIESName of thehydra.pg.model.Vertex.propertiesfield.static NameTYPE_Name of thehydra.pg.model.Vertextype.
-
Constructor Summary
Constructors Constructor Description Vertex(VertexLabel label, V id, java.util.Map<PropertyKey,V> properties)Constructs an immutableVertex.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <V> Vertex.Builder<V>builder()Creates a new fluent builder forVertex.intcompareTo(Vertex other)booleanequals(java.lang.Object other)inthashCode()java.lang.StringtoString()VertexwithId(V id)Returns a copy of thisVertexwithidreplaced.VertexwithLabel(VertexLabel label)Returns a copy of thisVertexwithlabelreplaced.VertexwithProperties(java.util.Map<PropertyKey,V> properties)Returns a copy of thisVertexwithpropertiesreplaced.
-
-
-
Field Detail
-
TYPE_
public static final Name TYPE_
Name of thehydra.pg.model.Vertextype.
-
LABEL
public static final Name LABEL
Name of thehydra.pg.model.Vertex.labelfield.
-
ID
public static final Name ID
Name of thehydra.pg.model.Vertex.idfield.
-
PROPERTIES
public static final Name PROPERTIES
Name of thehydra.pg.model.Vertex.propertiesfield.
-
label
public final VertexLabel label
The label of the vertex
-
id
public final V id
The unique identifier of the vertex
-
properties
public final java.util.Map<PropertyKey,V> properties
A key/value map of vertex properties
-
-
Constructor Detail
-
Vertex
public Vertex(VertexLabel label, V id, java.util.Map<PropertyKey,V> properties)
Constructs an immutableVertex.- Parameters:
label- The label of the vertexid- The unique identifier of the vertexproperties- A key/value map of vertex properties
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(Vertex other)
- Specified by:
compareToin interfacejava.lang.Comparable<V>
-
withLabel
public Vertex withLabel(VertexLabel label)
Returns a copy of thisVertexwithlabelreplaced.
-
withProperties
public Vertex withProperties(java.util.Map<PropertyKey,V> properties)
Returns a copy of thisVertexwithpropertiesreplaced.
-
builder
public static <V> Vertex.Builder<V> builder()
Creates a new fluent builder forVertex.
-
-