diff options
author | HuabingZhao <zhao.huabing@zte.com.cn> | 2017-10-18 14:08:18 +0800 |
---|---|---|
committer | HuabingZhao <zhao.huabing@zte.com.cn> | 2017-10-18 14:08:25 +0800 |
commit | 8884e6f236ac39f5a2f5b96d78cc2457351f2bd5 (patch) | |
tree | a878a25eeb6266e7a8b9ffffc2d0c2ceb0b4c2b0 /src | |
parent | 422fe052e2962bacd902bc0a10488ab017071a37 (diff) |
Remove duplicated class variable
Issue-Id: MSB-91
Change-Id: I66b7b80dc51ab726703c94e4e73a8f6d8b2c3593
Signed-off-by: HuabingZhao <zhao.huabing@zte.com.cn>
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceFullInfo.java | 81 | ||||
-rw-r--r-- | src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceInfo.java | 42 |
2 files changed, 51 insertions, 72 deletions
diff --git a/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceFullInfo.java b/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceFullInfo.java index e874962..58d9c81 100644 --- a/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceFullInfo.java +++ b/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceFullInfo.java @@ -20,59 +20,48 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @JsonIgnoreProperties(ignoreUnknown = true) public class MicroServiceFullInfo extends Service<NodeInfo> implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - private Set<NodeInfo> nodes; + // Reserved + private String status = "1"; - //Reserved - private String status = "1"; - - public Set<NodeInfo> getNodes() { - return nodes; - } - - public void setNodes(Set<NodeInfo> nodes) { - this.nodes = nodes; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } + public String getStatus() { + return status; + } + public void setStatus(String status) { + this.status = status; + } - public String toString() { - StringBuffer buf = new StringBuffer(); - buf.append("MicroService List:").append("\r\n");; - buf.append("serviceName:").append(getServiceName()).append("\r\n"); - buf.append("version:").append(getVersion()).append("\r\n"); - buf.append("url:").append(getUrl()).append("\r\n"); - buf.append("protocol:").append(getProtocol()).append("\r\n"); - buf.append("visualRange:").append(getVisualRange()).append("\r\n"); - buf.append("nodes:").append("\r\n"); + public String toString() { + StringBuffer buf = new StringBuffer(); + buf.append("MicroService List:").append("\r\n");; + buf.append("serviceName:").append(getServiceName()).append("\r\n"); + buf.append("version:").append(getVersion()).append("\r\n"); + buf.append("url:").append(getUrl()).append("\r\n"); + buf.append("protocol:").append(getProtocol()).append("\r\n"); + buf.append("visualRange:").append(getVisualRange()).append("\r\n"); + buf.append("nodes:").append("\r\n"); - for (NodeInfo nodeInstace : this.nodes) { - buf.append(" nodeId-").append(nodeInstace.getNodeId()).append("\r\n"); - buf.append(" ip-").append(nodeInstace.getIp()).append("\r\n"); - buf.append(" port-").append(nodeInstace.getPort()).append("\r\n"); - buf.append(" ttl-").append(nodeInstace.getTtl()).append("\r\n"); - buf.append(" Created_at-").append(nodeInstace.getCreated_at()).append("\r\n"); - buf.append(" Updated_at-").append(nodeInstace.getUpdated_at()).append("\r\n"); - buf.append(" Expiration-").append(nodeInstace.getExpiration()).append("\r\n"); - } - buf.append("metadata:").append("\r\n"); + for (NodeInfo nodeInstace : this.getNodes()) { + buf.append(" nodeId-").append(nodeInstace.getNodeId()).append("\r\n"); + buf.append(" ip-").append(nodeInstace.getIp()).append("\r\n"); + buf.append(" port-").append(nodeInstace.getPort()).append("\r\n"); + buf.append(" ttl-").append(nodeInstace.getTtl()).append("\r\n"); + buf.append(" Created_at-").append(nodeInstace.getCreated_at()).append("\r\n"); + buf.append(" Updated_at-").append(nodeInstace.getUpdated_at()).append("\r\n"); + buf.append(" Expiration-").append(nodeInstace.getExpiration()).append("\r\n"); + } + buf.append("metadata:").append("\r\n"); - if (this.getMetadata() != null && this.getMetadata().size() > 0) { - for (KeyVaulePair keyVaulePair : this.getMetadata()) { - buf.append(" key-").append(keyVaulePair.getKey()).append("\r"); - buf.append(" value-").append(keyVaulePair.getValue()).append("\r\n"); + if (this.getMetadata() != null && this.getMetadata().size() > 0) { + for (KeyVaulePair keyVaulePair : this.getMetadata()) { + buf.append(" key-").append(keyVaulePair.getKey()).append("\r"); + buf.append(" value-").append(keyVaulePair.getValue()).append("\r\n"); - } + } + } + return buf.toString(); } - return buf.toString(); - } } diff --git a/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceInfo.java b/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceInfo.java index 00ffe81..5b44369 100644 --- a/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceInfo.java +++ b/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceInfo.java @@ -23,33 +23,23 @@ import java.util.Set; * @date 2016-1-19 */ public class MicroServiceInfo extends Service<Node> implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - private Set<Node> nodes; + public String toString() { + StringBuffer buf = new StringBuffer(); + buf.append("MicroService List:").append("\r\n");; + buf.append("serviceName:").append(getServiceName()).append("\r\n"); + buf.append("version:").append(getVersion()).append("\r\n"); + buf.append("url:").append(getUrl()).append("\r\n"); + buf.append("protocol:").append(getProtocol()).append("\r\n"); + buf.append("visualRange:").append(getVisualRange()).append("\r\n"); + buf.append("nodes:").append("\r\n"); - public Set<Node> getNodes() { - return nodes; - } - - public void setNodes(Set<Node> nodes) { - this.nodes = nodes; - } - - public String toString() { - StringBuffer buf = new StringBuffer(); - buf.append("MicroService List:").append("\r\n");; - buf.append("serviceName:").append(getServiceName()).append("\r\n"); - buf.append("version:").append(getVersion()).append("\r\n"); - buf.append("url:").append(getUrl()).append("\r\n"); - buf.append("protocol:").append(getProtocol()).append("\r\n"); - buf.append("visualRange:").append(getVisualRange()).append("\r\n"); - buf.append("nodes:").append("\r\n"); - - for (Node nodeInstace : this.nodes) { - buf.append(" ip-").append(nodeInstace.getIp()).append("\r\n"); - buf.append(" port-").append(nodeInstace.getPort()).append("\r\n"); - buf.append(" ttl-").append(nodeInstace.getTtl()).append("\r\n"); + for (Node nodeInstace : this.getNodes()) { + buf.append(" ip-").append(nodeInstace.getIp()).append("\r\n"); + buf.append(" port-").append(nodeInstace.getPort()).append("\r\n"); + buf.append(" ttl-").append(nodeInstace.getTtl()).append("\r\n"); + } + return buf.toString(); } - return buf.toString(); - } } |