Replace Preconditions.CheckNotNull per RequireNonNull
[bgpcep.git] / programming / tunnel-api / src / main / java / org / opendaylight / bgpcep / programming / tunnel / TunnelProgrammingUtil.java
1 /*
2  * Copyright (c) 2013 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 package org.opendaylight.bgpcep.programming.tunnel;
9
10 import static java.util.Objects.requireNonNull;
11
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.programming.rev130930.BaseTunnelInput;
13 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
14 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link;
15 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.LinkKey;
16 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
17
18 /**
19  *
20  */
21 public final class TunnelProgrammingUtil {
22     private TunnelProgrammingUtil() {
23         throw new UnsupportedOperationException();
24     }
25
26     public static InstanceIdentifier<Link> linkIdentifier(final InstanceIdentifier<Topology> topology, final BaseTunnelInput input) {
27         requireNonNull(input.getLinkId());
28         return topology.child(Link.class, new LinkKey(input.getLinkId()));
29     }
30 }