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 com.google.common.primitives.UnsignedInteger;
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 UnsignedInteger peerId;
20 private final String routeId;
22 RouteUpdateKey(final UnsignedInteger peerId, final String routeKey) {
23 this.peerId = requireNonNull(peerId);
24 this.routeId = requireNonNull(routeKey);
27 UnsignedInteger getPeerId() {
36 public int hashCode() {
39 result = prime * result + this.peerId.hashCode();
40 result = prime * result + this.routeId.hashCode();
45 public boolean equals(final Object obj) {
49 if (!(obj instanceof RouteUpdateKey)) {
52 RouteUpdateKey other = (RouteUpdateKey) obj;
53 if (!this.peerId.equals(other.peerId)) {
56 if (!this.routeId.equals(other.routeId)) {