Fix java check style issue
[msb/discovery.git] / sdclient / discovery-service / src / main / java / org / onap / msb / sdclient / core / NodeInfo.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.util.Date;
17
18 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
19 import com.google.common.base.Objects;
20
21 public class NodeInfo extends Node {
22
23     private static final long serialVersionUID = 8955786461351557306L;
24
25     private String nodeId; // node唯一标识
26
27     private String status; // 实例健康检查状态
28
29
30     @JsonSerialize(using = CustomDateSerializer.class)
31     private Date expiration;
32
33     @JsonSerialize(using = CustomDateSerializer.class)
34     private Date created_at;
35
36     @JsonSerialize(using = CustomDateSerializer.class)
37     private Date updated_at;
38
39
40
41     public Date getExpiration() {
42         return expiration;
43     }
44
45     public void setExpiration(Date expiration) {
46         this.expiration = expiration;
47     }
48
49     public Date getCreated_at() {
50         return created_at;
51     }
52
53     public void setCreated_at(Date created_at) {
54         this.created_at = created_at;
55     }
56
57     public Date getUpdated_at() {
58         return updated_at;
59     }
60
61     public void setUpdated_at(Date updated_at) {
62         this.updated_at = updated_at;
63     }
64
65     public String getNodeId() {
66         return nodeId;
67     }
68
69     public void setNodeId(String nodeId) {
70         this.nodeId = nodeId;
71     }
72
73     public String getStatus() {
74         return status;
75     }
76
77     public void setStatus(String status) {
78         this.status = status;
79     }
80
81     @Override
82     public int hashCode() {
83         return Objects.hashCode(getIp(), getPort(), getHa_role(), status);
84     }
85
86     @Override
87     public boolean equals(Object other) {
88         if (this == other)
89             return true;
90         if (other instanceof NodeInfo) {
91             NodeInfo that = (NodeInfo) other;
92             return Objects.equal(getIp(), that.getIp()) && Objects.equal(getPort(), that.getPort());
93         } else {
94             return false;
95         }
96     }
97
98
99
100 }