2 * Copyright 2020 ZTE Corporation.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.onap.holmes.common.engine.entity;
19 public class EngineEntity {
22 private long lastModified;
24 public EngineEntity(String ip, int port) {
27 this.lastModified = System.currentTimeMillis();
30 public EngineEntity() {
33 public String getId() {
34 return ip + "_" + port;
37 public String getIp() {
41 public void setIp(String ip) {
45 public int getPort() {
49 public void setPort(int port) {
53 public long getLastModified() {
57 public void setLastModified(long lastModified) {
58 this.lastModified = lastModified;
62 public boolean equals(Object o) {
63 if (o == null || ! (o instanceof EngineEntity)) {
67 return ((EngineEntity) o).getId().equals(getId());
71 public int hashCode() {
72 return getId().hashCode();