projects
/
jSite2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
create new id if null id is set
[jSite2.git]
/
src
/
net
/
pterodactylus
/
jsite
/
core
/
Node.java
diff --git
a/src/net/pterodactylus/jsite/core/Node.java
b/src/net/pterodactylus/jsite/core/Node.java
index
bb61ee9
..
9a4d3be
100644
(file)
--- a/
src/net/pterodactylus/jsite/core/Node.java
+++ b/
src/net/pterodactylus/jsite/core/Node.java
@@
-77,7
+77,11
@@
public class Node extends AbstractBean {
* The internal ID of the node
*/
void setId(String id) {
* The internal ID of the node
*/
void setId(String id) {
- this.id = id;
+ if (id == null) {
+ this.id = Hex.toHex(IdGenerator.generateId());
+ } else {
+ this.id = id;
+ }
}
/**
}
/**
@@
-148,7
+152,7
@@
public class Node extends AbstractBean {
*/
@Override
public String toString() {
*/
@Override
public String toString() {
- return
name + " (" + hostname + ((port == 9481) ? ("") : (":" + port)) + ")
";
+ return
getClass().getName() + "[name=" + name + ",hostname=" + hostname + ",port=" + port + "]
";
}
}
}
}