/* * Copyright (C) 2015 Red Hat, Inc. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html * * Authors : Flavio Fernandes */ package org.opendaylight.ovsdb.openstack.netvirt; import org.opendaylight.ovsdb.openstack.netvirt.api.Action; public class NodeCacheManagerEvent extends AbstractEvent { private String nodeIdentifier; public NodeCacheManagerEvent(String nodeIdentifier, Action action) { super(HandlerType.NODE, action); this.nodeIdentifier = nodeIdentifier; } public String getNodeIdentifier() { return nodeIdentifier; } @Override public String toString() { return "NodeCacheManagerEvent [action=" + super.getAction() + ", nodeIdentifier=" + nodeIdentifier + "]"; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((nodeIdentifier == null) ? 0 : nodeIdentifier.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } if (!super.equals(obj)) { return false; } NodeCacheManagerEvent other = (NodeCacheManagerEvent) obj; if (nodeIdentifier == null) { if (other.nodeIdentifier != null) { return false; } } else if (!nodeIdentifier.equals(other.nodeIdentifier)) { return false; } return true; } }