diff options
author | HuabingZhao <zhao.huabing@zte.com.cn> | 2017-10-19 03:06:33 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-10-19 03:06:33 +0000 |
commit | a33ca6e2189e8dbf94a927488a49c5ae380485e5 (patch) | |
tree | 8194ae91642e505bc4f697f8fa9cf372401f42d2 | |
parent | 2d015b72e1f99fe9e2c34f5353fb406faae43790 (diff) | |
parent | 8884e6f236ac39f5a2f5b96d78cc2457351f2bd5 (diff) |
Merge "Remove duplicated class variable"v1.0.01.0.0-ONAP1.0.0-Amsterdam
-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(); - } } |