Fix java check style issue
[msb/discovery.git] / sdclient / discovery-service / src / main / java / org / onap / msb / sdclient / core / MicroServiceFullInfo.java
1 /**
2  * Copyright 2016-2017 ZTE, Inc. and others.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5  * in compliance with the License. You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software distributed under the License
10  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11  * or implied. See the License for the specific language governing permissions and limitations under
12  * the License.
13  */
14 package org.onap.msb.sdclient.core;
15
16 import java.io.Serializable;
17 import java.util.Set;
18
19 import com.google.common.base.Objects;
20
21
22 public class MicroServiceFullInfo extends Service<NodeInfo> implements Serializable {
23     private static final long serialVersionUID = 1L;
24
25     // 状态 0:不可用,待审核 1:可用,审核通过 2:审核失败
26     private String status = "1";
27
28     private boolean is_manual = false; // 手动注册:true; 自动注册:false
29
30     private Set<NodeInfo> nodes;
31
32
33     public Set<NodeInfo> getNodes() {
34         return nodes;
35     }
36
37     public void setNodes(Set<NodeInfo> nodes) {
38         this.nodes = nodes;
39     }
40
41     public String getStatus() {
42         return status;
43     }
44
45     public void setStatus(String status) {
46         this.status = status;
47     }
48
49
50     public boolean isIs_manual() {
51         return is_manual;
52     }
53
54     public void setIs_manual(boolean is_manual) {
55         this.is_manual = is_manual;
56     }
57
58     @Override
59     public int hashCode() {
60         return Objects.hashCode(getServiceName(), getVersion(), getProtocol(), getNamespace(), getUrl(),
61                         getVisualRange(), nodes);
62     }
63
64     @Override
65     public boolean equals(Object other) {
66         if (this == other)
67             return true;
68         if (other instanceof MicroServiceFullInfo) {
69             MicroServiceFullInfo that = (MicroServiceFullInfo) other;
70             return Objects.equal(getServiceName(), that.getServiceName())
71                             && Objects.equal(getVersion(), that.getVersion())
72                             && Objects.equal(getProtocol(), that.getProtocol())
73                             && Objects.equal(getNamespace(), that.getNamespace())
74                             && Objects.equal(getUrl(), that.getUrl())
75                             && Objects.equal(getVisualRange(), that.getVisualRange())
76                             && Objects.equal(nodes.hashCode(), that.nodes.hashCode());
77         } else {
78             return false;
79         }
80     }
81
82
83
84 }