From 8884e6f236ac39f5a2f5b96d78cc2457351f2bd5 Mon Sep 17 00:00:00 2001 From: HuabingZhao Date: Wed, 18 Oct 2017 14:08:18 +0800 Subject: Remove duplicated class variable Issue-Id: MSB-91 Change-Id: I66b7b80dc51ab726703c94e4e73a8f6d8b2c3593 Signed-off-by: HuabingZhao --- .../msb/sdk/discovery/entity/MicroServiceInfo.java | 42 +++++++++------------- 1 file changed, 16 insertions(+), 26 deletions(-) (limited to 'src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceInfo.java') 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 implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - private Set 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 getNodes() { - return nodes; - } - - public void setNodes(Set 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(); - } } -- cgit 1.2.3-korg