+ /**
+ * Creates a new node.
+ */
+ public Node() {
+ id = Hex.toHex(IdGenerator.generateId());
+ }
+
+ /**
+ * Returns the internal ID of the node.
+ *
+ * @return The internal ID of the node
+ */
+ String getId() {
+ return id;
+ }
+
+ /**
+ * Sets the internal ID of the node.
+ *
+ * @param id
+ * The internal ID of the node
+ */
+ void setId(String id) {
+ if (id == null) {
+ this.id = Hex.toHex(IdGenerator.generateId());
+ } else {
+ this.id = id;
+ }
+ }