Eliminate network-pcep-topology-config
[bgpcep.git] / pcep / topology / topology-provider / src / main / java / org / opendaylight / bgpcep / pcep / topology / provider / TopologyUtils.java
1 /*
2  * Copyright (c) 2021 PANTHEON.tech, s.r.o. 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.pcep.topology.provider;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
12 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
13 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
14 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
15
16 /**
17  * Utilities for dealing with various PCEP topology-related constructs.
18  */
19 final class TopologyUtils {
20     private TopologyUtils() {
21         // Hidden on purpose
22     }
23
24     static @NonNull String friendlyId(final KeyedInstanceIdentifier<Topology, TopologyKey> identifier) {
25         return friendlyId(identifier.getKey());
26     }
27
28     static @NonNull String friendlyId(final TopologyKey key) {
29         return friendlyId(key.getTopologyId());
30     }
31
32     static @NonNull String friendlyId(final TopologyId id) {
33         return id.getValue();
34     }
35 }