说明:node.getUNID()不会空指针异常
—————————————————————————-
if (this.engagingNodeID != null && !this.engagingNodeID.equals(“”)) {
if (this.engagingNodeID.equals(node.getUNID())) {
nodeState = “1”;
}
else {
nodeState = “2”;
}
}
——————————————————————————
//使用三目运算符,上面8行等价于以下的一行
nodeState=node.getUNID().equals(this.engagingNodeID)?”1″,”2″;