2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.bgp.rib.impl;
10 import static java.util.Objects.requireNonNull;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.PeerId;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
16 * Combined key formed as a concatenation of source peer and route identifiers.
17 * This is used to internally track updates which need to be processed.
19 final class RouteUpdateKey {
20 private final PeerId peerId;
21 private final PathArgument routeId;
23 RouteUpdateKey(final PeerId peerId, final PathArgument routeId) {
24 this.peerId = requireNonNull(peerId);
25 this.routeId = requireNonNull(routeId);
32 PathArgument getRouteId() {
37 public int hashCode() {
40 result = prime * result + this.peerId.hashCode();
41 result = prime * result + this.routeId.hashCode();
46 public boolean equals(final Object obj) {
50 if (!(obj instanceof RouteUpdateKey)) {
53 RouteUpdateKey other = (RouteUpdateKey) obj;
54 if (!this.peerId.equals(other.peerId)) {
57 if (!this.routeId.equals(other.routeId)) {