/*
 * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
package org.opendaylight.bgpcep.pcep.topology.provider.config;

import static com.google.common.base.Preconditions.checkNotNull;

import java.net.InetSocketAddress;
import javax.annotation.Nonnull;
import org.opendaylight.protocol.concepts.KeyMapping;
import org.opendaylight.protocol.pcep.SpeakerIdMapping;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.config.rev171025.pcep.config.SessionConfig;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;

public final class PCEPTopologyConfiguration {
    private final InetSocketAddress address;
    private final KeyMapping keys;
    private final TopologyId topologyId;
    private final short rpcTimeout;
    private final SpeakerIdMapping speakerIds;
    private final InstanceIdentifier<Topology> topology;

    public PCEPTopologyConfiguration(@Nonnull final SessionConfig config, @Nonnull final Topology topology) {
        checkNotNull(topology);
        this.address = PCEPTopologyProviderUtil
                .getInetSocketAddress(checkNotNull(config.getListenAddress()), checkNotNull(config.getListenPort()));
        this.keys = checkNotNull(PCEPTopologyProviderUtil.contructKeys(topology));
        this.speakerIds = checkNotNull(PCEPTopologyProviderUtil.contructSpeakersId(topology));
        this.topologyId = checkNotNull(topology.getTopologyId());
        this.rpcTimeout = config.getRpcTimeout();
        this.topology = InstanceIdentifier.builder(NetworkTopology.class)
                .child(Topology.class, new TopologyKey(this.topologyId)).build();
    }

    @Nonnull
    public TopologyId getTopologyId() {
        return this.topologyId;
    }

    @Nonnull
    public InstanceIdentifier<Topology> getTopology() {
        return this.topology;
    }

    public short getRpcTimeout() {
        return this.rpcTimeout;
    }

    @Nonnull
    public InetSocketAddress getAddress() {
        return this.address;
    }

    @Nonnull
    public KeyMapping getKeys() {
        return this.keys;
    }

    @Nonnull
    public SpeakerIdMapping getSpeakerIds() {
        return this.speakerIds;
    }
}

@@ -378,53 +378,36 @@
 tic 
-com.google.common.base.Preconditions.checkNot
+java.util.Objects.requireNon
 Null
@@ -1649,24 +1649,26 @@
         
-checkNot
+requireNon
 Null(top
@@ -1722,33 +1722,16 @@
 iderUtil
-%0A                
 .getInet
@@ -1744,24 +1744,26 @@
 Address(
-checkNot
+requireNon
 Null(con
@@ -1786,25 +1786,43 @@
 ress()),
- checkNot
+%0A                requireNon
 Null(con
@@ -1860,32 +1860,34 @@
 this.keys = 
-checkNot
+requireNon
 Null(PCEPTop
@@ -1955,24 +1955,26 @@
 erIds = 
-checkNot
+requireNon
 Null(PCE
@@ -2056,16 +2056,18 @@
 d = 
-checkNot
+requireNon
 Null

Replace deprecated CheckNotNull