Fix findbug and checkstyle issues
[bgpcep.git] / bgp / path-selection-mode / src / main / java / org / opendaylight / protocol / bgp / mode / impl / add / n / paths / AddPathBestNPathSelection.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  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
9 package org.opendaylight.protocol.bgp.mode.impl.add.n.paths;
10
11 import org.opendaylight.protocol.bgp.mode.api.PathSelectionMode;
12 import org.opendaylight.protocol.bgp.mode.api.RouteEntry;
13
14 public class AddPathBestNPathSelection implements PathSelectionMode {
15     private final Long npaths;
16
17     public AddPathBestNPathSelection(final Long npaths) {
18         this.npaths = npaths;
19     }
20
21     @Override
22     public void close() throws Exception {
23         //no-op
24     }
25
26     @Override
27     public RouteEntry createRouteEntry(final boolean isComplex) {
28         return isComplex ? new ComplexRouteEntry(this.getNBestPaths()) : new SimpleRouteEntry(this.getNBestPaths());
29     }
30
31     public Long getNBestPaths() {
32         return this.npaths;
33     }
34 }