Replace Preconditions.CheckNotNull per RequireNonNull
[bgpcep.git] / programming / topology-api / src / main / java / org / opendaylight / bgpcep / programming / topology / TopologyProgrammingUtil.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.topology;
9
10 import static java.util.Objects.requireNonNull;
11
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.programming.rev131102.TopologyInstructionInput;
13 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
14 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
15
16 /**
17  *
18  */
19 public final class TopologyProgrammingUtil {
20
21     private TopologyProgrammingUtil() {
22         throw new UnsupportedOperationException();
23     }
24
25     @SuppressWarnings("unchecked")
26     public static InstanceIdentifier<Topology> topologyForInput(final TopologyInstructionInput input) {
27         requireNonNull(input.getNetworkTopologyRef());
28         return (InstanceIdentifier<Topology>) input.getNetworkTopologyRef().getValue();
29     }
30 }