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 com.google.common.base.Preconditions;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.PeerId;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
15 * Combined key formed as a concatenation of source peer and route identifiers.
16 * This is used to internally track updates which need to be processed.
18 final class RouteUpdateKey {
19 private final PeerId peerId;
20 private final PathArgument routeId;
22 RouteUpdateKey(final PeerId peerId, final PathArgument routeId) {
23 this.peerId = Preconditions.checkNotNull(peerId);
24 this.routeId = Preconditions.checkNotNull(routeId);
31 PathArgument getRouteId() {
36 public int hashCode() {
39 result = prime * result + peerId.hashCode();
40 result = prime * result + routeId.hashCode();
45 public boolean equals(final Object obj) {
49 if (!(obj instanceof RouteUpdateKey)) {
52 RouteUpdateKey other = (RouteUpdateKey) obj;
53 if (!peerId.equals(other.peerId)) {
56 if (!routeId.equals(other.routeId)) {