X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=sdclient%2Fdiscovery-service%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fmsb%2Fsdclient%2Fcore%2FNodeInfo.java;h=45ac443d9f811fd296970eae38279c65c50a725e;hb=refs%2Fchanges%2F35%2F10735%2F1;hp=263b54db1e6a6ed04caa1e1c9f6bb1705418dd6d;hpb=2e7482cf8b50de9fb028ccd736901c3a1a9e3fbe;p=msb%2Fdiscovery.git diff --git a/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/core/NodeInfo.java b/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/core/NodeInfo.java index 263b54d..45ac443 100644 --- a/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/core/NodeInfo.java +++ b/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/core/NodeInfo.java @@ -1,17 +1,15 @@ /** * Copyright 2016-2017 ZTE, Inc. and others. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. */ package org.onap.msb.sdclient.core; @@ -23,21 +21,21 @@ import com.google.common.base.Objects; public class NodeInfo extends Node { private static final long serialVersionUID = 8955786461351557306L; - - private String nodeId; //node唯一标识 - - private String status; //实例健康检查状态 - - + + private String nodeId; // node唯一标识 + + private String status; // 实例健康检查状态 + + @JsonSerialize(using = CustomDateSerializer.class) private Date expiration; - + @JsonSerialize(using = CustomDateSerializer.class) private Date created_at; - + @JsonSerialize(using = CustomDateSerializer.class) private Date updated_at; - + public Date getExpiration() { @@ -79,28 +77,24 @@ public class NodeInfo extends Node { public void setStatus(String status) { this.status = status; } - + @Override public int hashCode() { - return Objects.hashCode(getIp(),getPort(),getHa_role(),status ); + return Objects.hashCode(getIp(), getPort(), getHa_role(), status); } - + @Override - public boolean equals(Object other) - { - if(this == other) + public boolean equals(Object other) { + if (this == other) return true; - if(other instanceof NodeInfo) - { - NodeInfo that = (NodeInfo)other; - return Objects.equal(getIp(), that.getIp()) - && Objects.equal(getPort(), that.getPort()); - } else - { + if (other instanceof NodeInfo) { + NodeInfo that = (NodeInfo) other; + return Objects.equal(getIp(), that.getIp()) && Objects.equal(getPort(), that.getPort()); + } else { return false; } } - - + + }