Reduce number of parameters for path selection
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / RouteEntryInfoImpl.java
1 /*
2  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
3  *
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
7  */
8 package org.opendaylight.protocol.bgp.rib.impl;
9
10 import static java.util.Objects.requireNonNull;
11
12 import javax.annotation.Nonnull;
13 import org.opendaylight.protocol.bgp.rib.spi.entry.RouteEntryInfo;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.PeerId;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
17
18 public final class RouteEntryInfoImpl implements RouteEntryInfo {
19     private final PeerId peerId;
20     private final NodeIdentifierWithPredicates key;
21     private final YangInstanceIdentifier rootPath;
22
23     public RouteEntryInfoImpl(final PeerId peerId, final NodeIdentifierWithPredicates key,
24             final YangInstanceIdentifier rootPath) {
25         this.peerId = requireNonNull(peerId);
26         this.key = requireNonNull(key);
27         this.rootPath = requireNonNull(rootPath);
28     }
29
30     @Nonnull
31     @Override
32     public PeerId getToPeerId() {
33         return this.peerId;
34     }
35
36     @Nonnull
37     @Override
38     public NodeIdentifierWithPredicates getRouteId() {
39         return this.key;
40     }
41
42     @Nonnull
43     @Override
44     public YangInstanceIdentifier getRootPath() {
45         return this.rootPath;
46     }
47 }