msb protocol synch change
[msb/apigateway.git] / msb-core / apiroute / apiroute-service / src / main / java / org / openo / msb / wrapper / consul / model / catalog / ServiceInfo.java
1 /**
2  * Copyright 2016 ZTE Corporation.
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.openo.msb.wrapper.consul.model.catalog;
17
18 import com.google.common.base.Objects;
19
20 public class ServiceInfo {
21
22     private   String serviceName;
23     
24     private   String version="";
25
26     public String getServiceName() {
27         return serviceName;
28     }
29
30     public void setServiceName(String serviceName) {
31         this.serviceName = serviceName;
32     }
33
34     public String getVersion() {
35         return version;
36     }
37
38     public void setVersion(String version) {
39         this.version = version;
40     }
41     
42     @Override
43     public boolean equals(Object other)
44     {
45         if(this == other)
46             return true;
47         if(other instanceof ServiceInfo)
48         {
49             ServiceInfo that = (ServiceInfo)other;
50             return Objects.equal(serviceName, that.serviceName) && Objects.equal(version, that.version);
51         } else
52         {
53             return false;
54         }
55     }
56     
57     @Override
58     public int hashCode() {
59         return Objects.hashCode(serviceName, version);
60     }
61     
62 }