*/
package org.opendaylight.ovsdb.southbound;
+import static java.util.Objects.requireNonNull;
import static org.opendaylight.ovsdb.southbound.SouthboundUtil.schemaMismatchLog;
import com.google.common.base.Joiner;
}
public static DatapathId createDatapathId(final Bridge bridge) {
- Preconditions.checkNotNull(bridge);
+ requireNonNull(bridge);
if (bridge.getDatapathIdColumn() == null) {
return null;
} else {
}
public static DatapathId createDatapathId(final Set<String> dpids) {
- Preconditions.checkNotNull(dpids);
+ requireNonNull(dpids);
if (dpids.isEmpty()) {
return null;
} else {
}
public static DatapathId createDatapathId(final String dpid) {
- Preconditions.checkNotNull(dpid);
+ requireNonNull(dpid);
DatapathId datapath;
if (dpid.matches("^[0-9a-fA-F]{16}")) {
Splitter splitter = Splitter.fixedLength(2);
}
public static Class<? extends InterfaceTypeBase> createInterfaceType(final String type) {
- Preconditions.checkNotNull(type);
- return SouthboundConstants.OVSDB_INTERFACE_TYPE_MAP.get(type);
+ return SouthboundConstants.OVSDB_INTERFACE_TYPE_MAP.get(requireNonNull(type));
}
public static String createOvsdbInterfaceType(final Class<? extends InterfaceTypeBase> mdsaltype) {
- Preconditions.checkNotNull(mdsaltype);
- ImmutableBiMap<Class<? extends InterfaceTypeBase>, String> mapper =
- SouthboundConstants.OVSDB_INTERFACE_TYPE_MAP.inverse();
- return mapper.get(mdsaltype);
+ return SouthboundConstants.OVSDB_INTERFACE_TYPE_MAP.inverse().get(requireNonNull(mdsaltype));
}
public static List<ProtocolEntry> createMdsalProtocols(final Bridge bridge) {
* @return class matching the input QoS type {@link QosTypeBase}
*/
public static Class<? extends QosTypeBase> createQosType(final String type) {
- Preconditions.checkNotNull(type);
+ requireNonNull(type);
if (type.isEmpty()) {
LOG.info("QoS type not supplied");
return QosTypeBase.class;