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