import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.ListenableFuture;
-import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicLong;
@Override
public boolean isNodeOwner(final InstanceIdentifier<FlowCapableNode> ident) {
- return Objects.nonNull(ident) && deviceMastershipManager.isDeviceMastered(ident.firstKeyOf(Node.class).getId());
+ return ident != null && deviceMastershipManager.isDeviceMastered(ident.firstKeyOf(Node.class).getId());
}
@VisibleForTesting
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
-import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.opendaylight.mdsal.binding.api.DataBroker;
@Override
public void close() {
- if (Objects.nonNull(dataTreeConfigChangeListener)) {
+ if (dataTreeConfigChangeListener != null) {
dataTreeConfigChangeListener.close();
dataTreeConfigChangeListener = null;
}
- if (Objects.nonNull(dataTreeOperationalChangeListener)) {
+ if (dataTreeOperationalChangeListener != null) {
dataTreeOperationalChangeListener.close();
dataTreeOperationalChangeListener = null;
}
syncThreadPool.shutdown();
}
-
}
import java.util.Collection;
import java.util.Date;
import java.util.List;
-import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nonnull;
import org.opendaylight.mdsal.binding.api.DataObjectModification;
return result;
}
- private Optional<ListenableFuture<Boolean>> skipModification(final DataTreeModification<Node> modification) {
+ private static Optional<ListenableFuture<Boolean>> skipModification(final DataTreeModification<Node> modification) {
if (LOG.isTraceEnabled()) {
LOG.trace("Skipping operational modification: {}, before {}, after {}",
ModificationUtil.nodeIdValue(modification),
return Optional.empty();
}
- private boolean isDelete(final DataObjectModification<Node> nodeModification) {
- return Objects.nonNull(nodeModification.getDataBefore()) && Objects.isNull(nodeModification.getDataAfter());
+ private static boolean isDelete(final DataObjectModification<Node> nodeModification) {
+ return nodeModification.getDataBefore() != null && nodeModification.getDataAfter() == null;
}
/**
* All connectors disappeared from operational store (logical delete).
*/
- private boolean isDeleteLogical(final DataObjectModification<Node> nodeModification) {
+ private static boolean isDeleteLogical(final DataObjectModification<Node> nodeModification) {
return !safeConnectorsEmpty(nodeModification.getDataBefore())
&& safeConnectorsEmpty(nodeModification.getDataAfter());
}
- private boolean isAdd(final DataObjectModification<Node> nodeModification) {
- return Objects.isNull(nodeModification.getDataBefore()) && Objects.nonNull(nodeModification.getDataAfter());
+ private static boolean isAdd(final DataObjectModification<Node> nodeModification) {
+ return nodeModification.getDataBefore() == null && nodeModification.getDataAfter() != null;
}
/**
* All connectors appeared in operational store (logical add).
*/
- private boolean isAddLogical(final DataObjectModification<Node> nodeModification) {
+ private static boolean isAddLogical(final DataObjectModification<Node> nodeModification) {
return safeConnectorsEmpty(nodeModification.getDataBefore())
&& !safeConnectorsEmpty(nodeModification.getDataAfter());
}
-/**
+/*
* Copyright (c) 2016 Cisco Systems, Inc. and others. 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.openflowplugin.applications.frsync.impl;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListeningExecutorService;
import java.util.HashMap;
import java.util.Map;
-import java.util.Objects;
import java.util.concurrent.Semaphore;
import org.opendaylight.openflowplugin.applications.frsync.SemaphoreKeeper;
import org.opendaylight.openflowplugin.applications.frsync.SyncReactor;
super(delegate, executorService);
}
+ @Override
public ListenableFuture<Boolean> syncup(final InstanceIdentifier<FlowCapableNode> flowcapableNodePath,
final SyncupEntry syncupEntry) {
Semaphore guard = null;
try {
guard = semaphoreKeeper.summonGuardAndAcquire(flowcapableNodePath);
- if (Objects.isNull(guard)) {
+ if (guard == null) {
return Futures.immediateFuture(Boolean.FALSE);
}
final boolean newTaskNecessary = updateCompressionState(flowcapableNodePath, syncupEntry);
}
}
+ @Override
protected ListenableFuture<Boolean> doSyncupInFuture(final InstanceIdentifier<FlowCapableNode> flowcapableNodePath,
final SyncupEntry syncupEntry) {
final SyncupEntry lastCompressionState = removeLastCompressionState(flowcapableNodePath);
Semaphore guard = null;
try {
guard = semaphoreKeeper.summonGuardAndAcquire(flowcapableNodePath);
- if (Objects.isNull(guard)) {
- return null;
- }
- return compressionQueue.remove(flowcapableNodePath);
+ return guard == null ? null : compressionQueue.remove(flowcapableNodePath);
} finally {
semaphoreKeeper.releaseGuard(guard);
}
-/**
+/*
* Copyright (c) 2016 Cisco Systems, Inc. and others. 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.openflowplugin.applications.frsync.impl;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
-import java.util.Objects;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
final NodeId nodeId = PathUtil.digNodeId(flowcapableNodePath);
final long stampBeforeGuard = System.nanoTime();
final Semaphore guard = semaphoreKeeper.summonGuardAndAcquire(flowcapableNodePath);
- if (Objects.isNull(guard)) {
+ if (guard == null) {
return Futures.immediateFuture(Boolean.FALSE);
}
final long stampAfterGuard = System.nanoTime();
-/**
+/*
* Copyright (c) 2016 Cisco Systems, Inc. and others. 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.openflowplugin.applications.frsync.util;
import com.google.common.base.Preconditions;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
-import java.util.Objects;
import java.util.concurrent.Semaphore;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@Override
public void releaseGuard(@Nullable final Semaphore guard) {
- if (Objects.nonNull(guard)) {
+ if (guard != null) {
guard.release();
}
}
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
-import java.util.Objects;
import java.util.Optional;
-
import org.apache.commons.lang3.ArrayUtils;
import org.opendaylight.mdsal.eos.binding.api.Entity;
import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
}
private static boolean isLLDP(final byte[] packet) {
- if (Objects.isNull(packet) || packet.length < MINIMUM_LLDP_SIZE) {
+ if (packet == null || packet.length < MINIMUM_LLDP_SIZE) {
return false;
}
*/
package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match;
-import java.util.Objects;
import java.util.Optional;
import org.opendaylight.openflowjava.nx.codec.match.NiciraMatchCodecs;
import org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava;
return MatchUtil.createDefaultMatchEntryBuilder(nxmNxReg.getReg(),
Nxm1Class.class,
regCaseValueBuilder.build())
- .setHasMask(Objects.nonNull(nxmNxReg.getMask()))
+ .setHasMask(nxmNxReg.getMask() != null)
.build();
}
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
-import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
public boolean submitTransaction(boolean doSync) {
synchronized (txLock) {
if (!submitIsEnabled) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("transaction not committed - submit block issued");
- }
+ LOG.trace("transaction not committed - submit block issued");
return false;
}
- if (Objects.isNull(writeTx)) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("nothing to commit - submit returns true");
- }
+ if (writeTx == null) {
+ LOG.trace("nothing to commit - submit returns true");
return true;
}
Preconditions.checkState(TransactionChainManagerStatus.WORKING == transactionChainManagerStatus,
import java.lang.management.ManagementFactory;
import java.util.Collection;
import java.util.List;
-import java.util.Objects;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
@SuppressWarnings("checkstyle:IllegalCatch")
private static void gracefulShutdown(final AutoCloseable closeable) {
- if (Objects.isNull(closeable)) {
- return;
- }
-
- try {
- closeable.close();
- } catch (Exception e) {
- LOG.warn("Failed to shutdown {} gracefully.", closeable);
+ if (closeable != null) {
+ try {
+ closeable.close();
+ } catch (Exception e) {
+ LOG.warn("Failed to shutdown {} gracefully.", closeable);
+ }
}
}
private static void gracefulShutdown(final Timer timer) {
- if (Objects.isNull(timer)) {
- return;
- }
-
- try {
- timer.stop();
- } catch (IllegalStateException e) {
- LOG.warn("Failed to shutdown {} gracefully.", timer);
+ if (timer != null) {
+ try {
+ timer.stop();
+ } catch (IllegalStateException e) {
+ LOG.warn("Failed to shutdown {} gracefully.", timer);
+ }
}
}
private static void gracefulShutdown(final ExecutorService executorService) {
- if (Objects.isNull(executorService)) {
- return;
- }
-
- try {
- executorService.shutdownNow();
- } catch (SecurityException e) {
- LOG.warn("Failed to shutdown {} gracefully.", executorService);
+ if (executorService != null) {
+ try {
+ executorService.shutdownNow();
+ } catch (SecurityException e) {
+ LOG.warn("Failed to shutdown {} gracefully.", executorService);
+ }
}
}
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Nonnull;
import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationListener;
properties.forEach((propertyName, newValue) -> {
final String originalValue = propertyMap.get(propertyName);
- if (Objects.nonNull(originalValue)) {
+ if (originalValue != null) {
if (originalValue.equals(newValue)) {
return;
}
originalValue,
newValue);
} else {
- if (Objects.isNull(newValue)) {
+ if (newValue == null) {
return;
}
-/**
+/*
* Copyright (c) 2015 Cisco Systems, Inc. and others. 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.openflowplugin.impl.connection;
import com.google.common.base.MoreObjects;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import java.util.Objects;
import java.util.Optional;
import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
private void disconnectDevice(final boolean propagate,
final boolean forced) {
- final String device =
- Objects.nonNull(nodeId) ? nodeId.getValue() : getConnectionAdapter().getRemoteAddress().toString();
+ final String device = nodeId != null ? nodeId.getValue() : getConnectionAdapter().getRemoteAddress().toString();
final short auxiliaryId = Optional
.ofNullable(getFeatures())
.flatMap(features -> Optional
}
private void propagateDeviceDisconnectedEvent() {
- if (Objects.nonNull(deviceDisconnectedHandler)) {
+ if (deviceDisconnectedHandler != null) {
final BigInteger datapathId = featuresReply != null ? featuresReply.getDatapathId() : BigInteger.ZERO;
if (LOG.isDebugEnabled()) {
LOG.debug("Propagating connection closed event: {}, datapathId:{}.",
*/
@Override
public String getSafeNodeIdForLOG() {
- return Objects.nonNull(nodeId) ? nodeId.getValue() : "null";
+ return nodeId == null ? "null" : nodeId.getValue();
}
@Override
@Override
public String toString() {
- return Objects.isNull(nodeId) ? "null" : getNodeId().getValue();
+ return nodeId == null ? "null" : getNodeId().getValue();
}
public void setOutboundQueueProvider(final OutboundQueue outboundQueueProvider) {
* 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.openflowplugin.impl.datastore.multipart;
-import java.util.Objects;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceRegistry;
import org.opendaylight.openflowplugin.api.openflow.device.TxFacade;
import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowDescriptor;
.getDeviceFlowRegistry()
.retrieveDescriptor(flowRegistryKey);
- if (Objects.nonNull(flowDescriptor)) {
- final FlowKey key = new FlowKey(flowDescriptor
- .getFlowId());
+ if (flowDescriptor != null) {
+ final FlowKey key = new FlowKey(flowDescriptor.getFlowId());
writeToTransaction(
getInstanceIdentifier()
final OpenflowVersion openflowVersion = OpenflowVersion.get(deviceInfo.getVersion());
// Try to get ingress from match
- final NodeConnectorRef nodeConnectorRef = Objects.nonNull(packetIn.getIngress())
+ final NodeConnectorRef nodeConnectorRef = packetIn.getIngress() != null
? packetIn.getIngress() : Optional.ofNullable(match)
.map(Match::getInPort)
.map(nodeConnectorId -> InventoryDataServiceUtil
public boolean processAlienMessage(final OfHeader message) {
final Class<? extends DataContainer> implementedInterface = message.getImplementedInterface();
- if (Objects.nonNull(implementedInterface) && org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service
- .rev130709.PacketInMessage.class.equals(implementedInterface)) {
+ if (org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketInMessage.class
+ .equals(implementedInterface)) {
final org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709
.PacketInMessage packetInMessage = (org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service
.rev130709.PacketInMessage) message;
* 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.openflowplugin.impl.device.initialization;
import com.google.common.base.Function;
import com.google.common.util.concurrent.MoreExecutors;
import java.util.ArrayList;
import java.util.List;
-import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.Future;
import java.util.stream.Collectors;
Futures.addCallback(future, new FutureCallback<RpcResult<List<OfHeader>>>() {
@Override
public void onSuccess(@Nonnull final RpcResult<List<OfHeader>> result) {
- if (Objects.nonNull(result.getResult())) {
+ if (result.getResult() != null) {
LOG.info("Static node {} info: {} collected", deviceContext.getDeviceInfo(), type);
translateAndWriteResult(
type,
result.getErrors().forEach(rpcError -> {
LOG.warn("Failed to retrieve static node {} info: {}", type, rpcError.getMessage());
- if (LOG.isTraceEnabled() && Objects.nonNull(rpcError.getCause())) {
+ if (LOG.isTraceEnabled() && rpcError.getCause() != null) {
LOG.trace("Detailed error:", rpcError.getCause());
}
});
final DeviceContext deviceContext,
@Nullable final MultipartWriterProvider multipartWriterProvider,
@Nullable final ConvertorExecutor convertorExecutor) {
- if (Objects.nonNull(result)) {
+ if (result != null) {
try {
result.forEach(reply -> {
// First, translate collected data to proper openflowplugin representation
return Futures.transform(service.handleServiceCall(multipartType),
input -> {
- if (Objects.isNull(input.getResult()) && input.isSuccessful()) {
+ if (input.getResult() == null && input.isSuccessful()) {
return RpcResultBuilder.<List<OfHeader>>success(null).build();
}
new MultiLayerMultipartCollectorService(deviceContext, deviceContext);
return Futures.transform(service.handleServiceCall(multipartType), input -> {
- if (Objects.isNull(input.getResult()) && input.isSuccessful()) {
+ if (input.getResult() == null && input.isSuccessful()) {
return RpcResultBuilder.<List<OfHeader>>success(null).build();
}
: RpcResultBuilder.<List<OfHeader>>failed().withRpcErrors(input.getErrors()).build();
}, MoreExecutors.directExecutor());
}
-
}
-/**
+/*
* Copyright (c) 2015 Cisco Systems, Inc. and others. 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.openflowplugin.impl.device.listener;
import com.google.common.base.Preconditions;
import java.util.ArrayList;
import java.util.List;
-import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
/**
* Implementation for {@link MultiMsgCollector} interface.
*
public void endCollecting(@Nullable final EventIdentifier eventIdentifier) {
final RpcResult<List<T>> rpcResult = RpcResultBuilder.success(replyCollection).build();
- if (Objects.nonNull(eventIdentifier)) {
+ if (eventIdentifier != null) {
EventsTimeCounter.markEnd(eventIdentifier);
}
@Override
public <T extends OFPManager> void addManager(final T manager) {
- if (Objects.isNull(deviceManager) && manager instanceof DeviceManager) {
+ if (deviceManager == null && manager instanceof DeviceManager) {
LOG.trace("Context chain holder: Device manager OK.");
deviceManager = (DeviceManager) manager;
- } else if (Objects.isNull(rpcManager) && manager instanceof RpcManager) {
+ } else if (rpcManager == null && manager instanceof RpcManager) {
LOG.trace("Context chain holder: RPC manager OK.");
rpcManager = (RpcManager) manager;
- } else if (Objects.isNull(statisticsManager) && manager instanceof StatisticsManager) {
+ } else if (statisticsManager == null && manager instanceof StatisticsManager) {
LOG.trace("Context chain holder: Statistics manager OK.");
statisticsManager = (StatisticsManager) manager;
- } else if (Objects.isNull(roleManager) && manager instanceof RoleManager) {
+ } else if (roleManager == null && manager instanceof RoleManager) {
LOG.trace("Context chain holder: Role manager OK.");
roleManager = (RoleManager) manager;
}
@VisibleForTesting
boolean checkAllManagers() {
- return Objects.nonNull(deviceManager) && Objects.nonNull(rpcManager) && Objects.nonNull(statisticsManager)
- && Objects.nonNull(roleManager);
+ return deviceManager != null && rpcManager != null && statisticsManager != null && roleManager != null;
}
@Override
.firstKeyOf(Entity.class)
.getName();
- if (Objects.nonNull(entityName)) {
+ if (entityName != null) {
LOG.debug("Entity {} has no owner", entityName);
try {
//TODO:Remove notifications
auxiliaryConnections.clear();
// If we are still registered and we are not already closing, then close the registration
- if (Objects.nonNull(registration)) {
+ if (registration != null) {
try {
registration.close();
registration = null;
* 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.openflowplugin.impl.protocol.deserialization;
-import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Function;
import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerExtensionProvider;
private static Function<Byte, Function<ActionPath, Consumer<OFDeserializer<Instruction>>>> createInjector(
final DeserializerExtensionProvider provider,
final short version) {
- return code -> actionPath -> deserializer -> provider.registerDeserializer((Objects.nonNull(actionPath)
+ return code -> actionPath -> deserializer -> provider.registerDeserializer(actionPath != null
? new MessageCodeActionExperimenterKey(version,
code,
Instruction.class,
actionPath,
null)
- : new MessageCodeExperimenterKey(version, code, Instruction.class, null)),
+ : new MessageCodeExperimenterKey(version, code, Instruction.class, null),
deserializer);
}
-
}
*/
package org.opendaylight.openflowplugin.impl.protocol.deserialization.key;
-import java.util.Objects;
import org.opendaylight.openflowplugin.api.openflow.protocol.deserialization.MessageCodeExperimenterKey;
import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
public class MessageCodeActionExperimenterKey extends MessageCodeExperimenterKey {
- private ActionPath actionPath;
+ private final ActionPath actionPath;
/**
* Constructor.
@Override
public int hashCode() {
final int prime = 31;
- return prime * super.hashCode() + (Objects.isNull(actionPath) ? 0 : actionPath.ordinal());
+ return prime * super.hashCode() + (actionPath == null ? 0 : actionPath.ordinal());
}
@Override
*/
package org.opendaylight.openflowplugin.impl.protocol.deserialization.key;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
import org.opendaylight.openflowplugin.extension.api.path.MatchPath;
public class MessageCodeMatchKey extends MessageCodeKey {
- private MatchPath matchPath;
+ private final MatchPath matchPath;
/**
* Constructor.
@Override
public int hashCode() {
final int prime = 31;
- return prime * super.hashCode() + (Objects.isNull(matchPath) ? 0 : matchPath.ordinal());
+ return prime * super.hashCode() + (matchPath == null ? 0 : matchPath.ordinal());
}
@Override
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatch;
final Layer3Match layer3Match = builder.getLayer3Match();
final int arpOp = message.readUnsignedShort();
- if (Objects.isNull(layer3Match)) {
+ if (layer3Match == null) {
builder.setLayer3Match(new ArpMatchBuilder()
.setArpOp(arpOp)
.build());
- } else if (layer3Match instanceof ArpMatch
- && Objects.isNull(((ArpMatch) layer3Match).getArpOp())) {
+ } else if (layer3Match instanceof ArpMatch && ((ArpMatch) layer3Match).getArpOp() == null) {
builder.setLayer3Match(new ArpMatchBuilder((ArpMatch) layer3Match)
.setArpOp(arpOp)
.build());
throwErrorOnMalformed(builder, "layer3Match", "arpOp");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpSourceHardwareAddressBuilder;
arpBuilder.setMask(OxmDeserializerHelper.convertMacAddress(message));
}
- if (Objects.isNull(layer3Match)) {
+ if (layer3Match == null) {
builder.setLayer3Match(new ArpMatchBuilder()
.setArpSourceHardwareAddress(arpBuilder.build())
.build());
- } else if (layer3Match instanceof ArpMatch
- && Objects.isNull(((ArpMatch) layer3Match).getArpSourceHardwareAddress())) {
+ } else if (layer3Match instanceof ArpMatch && ((ArpMatch) layer3Match).getArpSourceHardwareAddress() == null) {
builder.setLayer3Match(new ArpMatchBuilder((ArpMatch) layer3Match)
.setArpSourceHardwareAddress(arpBuilder.build())
.build());
throwErrorOnMalformed(builder, "layer3Match", "arpSourceHardwareAddress");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
final Layer3Match layer3Match = builder.getLayer3Match();
final Ipv4Prefix prefix = readPrefix(message, hasMask);
- if (Objects.isNull(layer3Match)) {
+ if (layer3Match == null) {
builder.setLayer3Match(new ArpMatchBuilder()
.setArpSourceTransportAddress(prefix)
.build());
- } else if (layer3Match instanceof ArpMatch
- && Objects.isNull(((ArpMatch) layer3Match).getArpSourceTransportAddress())) {
+ } else if (layer3Match instanceof ArpMatch && ((ArpMatch) layer3Match).getArpSourceTransportAddress() == null) {
builder.setLayer3Match(new ArpMatchBuilder((ArpMatch) layer3Match)
.setArpSourceTransportAddress(prefix)
.build());
throwErrorOnMalformed(builder, "layer3Match", "arpSourceTransportAddress");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpTargetHardwareAddressBuilder;
arpBuilder.setMask(OxmDeserializerHelper.convertMacAddress(message));
}
- if (Objects.isNull(layer3Match)) {
+ if (layer3Match == null) {
builder.setLayer3Match(new ArpMatchBuilder()
.setArpTargetHardwareAddress(arpBuilder.build())
.build());
- } else if (layer3Match instanceof ArpMatch
- && Objects.isNull(((ArpMatch) layer3Match).getArpTargetHardwareAddress())) {
+ } else if (layer3Match instanceof ArpMatch && ((ArpMatch) layer3Match).getArpTargetHardwareAddress() == null) {
builder.setLayer3Match(new ArpMatchBuilder((ArpMatch) layer3Match)
.setArpTargetHardwareAddress(arpBuilder.build())
.build());
throwErrorOnMalformed(builder, "layer3Match", "arpTargetHardwareAddress");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
final Layer3Match layer3Match = builder.getLayer3Match();
final Ipv4Prefix prefix = readPrefix(message, hasMask);
- if (Objects.isNull(layer3Match)) {
+ if (layer3Match == null) {
builder.setLayer3Match(new ArpMatchBuilder()
.setArpTargetTransportAddress(prefix)
.build());
- } else if (layer3Match instanceof ArpMatch
- && Objects.isNull(((ArpMatch) layer3Match).getArpTargetTransportAddress())) {
+ } else if (layer3Match instanceof ArpMatch && ((ArpMatch) layer3Match).getArpTargetTransportAddress() == null) {
builder.setLayer3Match(new ArpMatchBuilder((ArpMatch) layer3Match)
.setArpTargetTransportAddress(prefix)
.build());
throwErrorOnMalformed(builder, "layer3Match", "arpTargetTransportAddress");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestinationBuilder;
ethernetDestinationBuilder.setMask(OxmDeserializerHelper.convertMacAddress(message));
}
- if (Objects.isNull(ethernetMatch)) {
+ if (ethernetMatch == null) {
builder.setEthernetMatch(new EthernetMatchBuilder()
.setEthernetDestination(ethernetDestinationBuilder.build())
.build());
- } else if (Objects.isNull(ethernetMatch.getEthernetDestination())) {
+ } else if (ethernetMatch.getEthernetDestination() == null) {
builder.setEthernetMatch(new EthernetMatchBuilder(ethernetMatch)
.setEthernetDestination(ethernetDestinationBuilder.build())
.build());
throwErrorOnMalformed(builder, "ethernetMatch", "ethernetDestination");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder;
ethernetSourceBuilder.setMask(OxmDeserializerHelper.convertMacAddress(message));
}
- if (Objects.isNull(ethernetMatch)) {
+ if (ethernetMatch == null) {
builder.setEthernetMatch(new EthernetMatchBuilder()
.setEthernetSource(ethernetSourceBuilder.build())
.build());
- } else if (Objects.isNull(ethernetMatch.getEthernetSource())) {
+ } else if (ethernetMatch.getEthernetSource() == null) {
builder.setEthernetMatch(new EthernetMatchBuilder(ethernetMatch)
.setEthernetSource(ethernetSourceBuilder.build())
.build());
throwErrorOnMalformed(builder, "ethernetMatch", "ethernetSource");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder;
processHeader(message);
final int type = message.readUnsignedShort();
- if (Objects.isNull(builder.getEthernetMatch())) {
+ if (builder.getEthernetMatch() == null) {
builder.setEthernetMatch(new EthernetMatchBuilder()
.setEthernetType(new EthernetTypeBuilder()
.setType(new EtherType(Long.valueOf(type)))
.build())
.build());
- } else if (Objects.isNull(builder.getEthernetMatch().getEthernetType())) {
+ } else if (builder.getEthernetMatch().getEthernetType() == null) {
builder.setEthernetMatch(new EthernetMatchBuilder(builder.getEthernetMatch())
.setEthernetType(new EthernetTypeBuilder()
.setType(new EtherType(Long.valueOf(type)))
throwErrorOnMalformed(builder, "ethernetMatch", "ethernetType");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder;
processHeader(message);
final short code = message.readUnsignedByte();
- if (Objects.isNull(builder.getIcmpv4Match())) {
+ if (builder.getIcmpv4Match() == null) {
builder.setIcmpv4Match(new Icmpv4MatchBuilder()
.setIcmpv4Code(code)
.build());
- } else if (Objects.isNull(builder.getIcmpv4Match().getIcmpv4Code())) {
+ } else if (builder.getIcmpv4Match().getIcmpv4Code() == null) {
builder.setIcmpv4Match(new Icmpv4MatchBuilder(builder.getIcmpv4Match())
.setIcmpv4Code(code)
.build());
throwErrorOnMalformed(builder, "icmpv4Match", "icmpv4Code");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder;
processHeader(message);
final short type = message.readUnsignedByte();
- if (Objects.isNull(builder.getIcmpv4Match())) {
+ if (builder.getIcmpv4Match() == null) {
builder.setIcmpv4Match(new Icmpv4MatchBuilder()
.setIcmpv4Type(type)
.build());
- } else if (Objects.isNull(builder.getIcmpv4Match().getIcmpv4Type())) {
+ } else if (builder.getIcmpv4Match().getIcmpv4Type() == null) {
builder.setIcmpv4Match(new Icmpv4MatchBuilder(builder.getIcmpv4Match())
.setIcmpv4Type(type)
.build());
throwErrorOnMalformed(builder, "icmpv4Match", "icmpv4Type");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder;
processHeader(message);
final short code = message.readUnsignedByte();
- if (Objects.isNull(builder.getIcmpv6Match())) {
+ if (builder.getIcmpv6Match() == null) {
builder.setIcmpv6Match(new Icmpv6MatchBuilder()
.setIcmpv6Code(code)
.build());
- } else if (Objects.isNull(builder.getIcmpv6Match().getIcmpv6Code())) {
+ } else if (builder.getIcmpv6Match().getIcmpv6Code() == null) {
builder.setIcmpv6Match(new Icmpv6MatchBuilder(builder.getIcmpv6Match())
.setIcmpv6Code(code)
.build());
throwErrorOnMalformed(builder, "icmpv6Match", "icmpv6Code");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder;
processHeader(message);
final short type = message.readUnsignedByte();
- if (Objects.isNull(builder.getIcmpv6Match())) {
+ if (builder.getIcmpv6Match() == null) {
builder.setIcmpv6Match(new Icmpv6MatchBuilder()
.setIcmpv6Type(type)
.build());
- } else if (Objects.isNull(builder.getIcmpv6Match().getIcmpv6Type())) {
+ } else if (builder.getIcmpv6Match().getIcmpv6Type() == null) {
builder.setIcmpv6Match(new Icmpv6MatchBuilder(builder.getIcmpv6Match())
.setIcmpv6Type(type)
.build());
throwErrorOnMalformed(builder, "icmpv6Match", "icmpv6Type");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
processHeader(message);
final long port = message.readUnsignedInt();
- if (Objects.isNull(builder.getInPhyPort())) {
+ if (builder.getInPhyPort() == null) {
builder.setInPhyPort(new NodeConnectorId(OpenflowPortsUtil
.getProtocolAgnosticPortUri(EncodeConstants.OF13_VERSION_ID, port)));
} else {
throwErrorOnMalformed(builder, "inPhyPort");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
processHeader(message);
final long port = message.readUnsignedInt();
- if (Objects.isNull(builder.getInPort())) {
+ if (builder.getInPort() == null) {
builder.setInPort(new NodeConnectorId(OpenflowPortsUtil.getProtocolAgnosticPortUri(EncodeConstants
.OF13_VERSION_ID, port)));
} else {
throwErrorOnMalformed(builder, "inPort");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Dscp;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
processHeader(message);
final short dscp = message.readUnsignedByte();
- if (Objects.isNull(builder.getIpMatch())) {
+ if (builder.getIpMatch() == null) {
builder.setIpMatch(new IpMatchBuilder()
.setIpDscp(new Dscp(dscp))
.build());
- } else if (Objects.isNull(builder.getIpMatch().getIpDscp())) {
+ } else if (builder.getIpMatch().getIpDscp() == null) {
builder.setIpMatch(new IpMatchBuilder(builder.getIpMatch())
.setIpDscp(new Dscp(dscp))
.build());
throwErrorOnMalformed(builder, "ipMatch", "ipDscp");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
processHeader(message);
final short ecn = message.readUnsignedByte();
- if (Objects.isNull(builder.getIpMatch())) {
+ if (builder.getIpMatch() == null) {
builder.setIpMatch(new IpMatchBuilder()
.setIpEcn(ecn)
.build());
- } else if (Objects.isNull(builder.getIpMatch().getIpEcn())) {
+ } else if (builder.getIpMatch().getIpEcn() == null) {
builder.setIpMatch(new IpMatchBuilder(builder.getIpMatch())
.setIpEcn(ecn)
.build());
throwErrorOnMalformed(builder, "ipMatch", "ipEcn");
}
}
-
}
package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
processHeader(message);
final short proto = message.readUnsignedByte();
- if (Objects.isNull(builder.getIpMatch())) {
+ if (builder.getIpMatch() == null) {
builder.setIpMatch(new IpMatchBuilder()
.setIpProtocol(proto)
.build());
- } else if (Objects.isNull(builder.getIpMatch().getIpProtocol())) {
+ } else if (builder.getIpMatch().getIpProtocol() == null) {
builder.setIpMatch(new IpMatchBuilder(builder.getIpMatch())
.setIpProtocol(proto)
.build());
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import javax.annotation.Nullable;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
private static void setPrefixMatch(final MatchBuilder builder, final Ipv4Address address, @Nullable final byte[]
mask) {
- if (Objects.isNull(builder.getLayer3Match())) {
+ if (builder.getLayer3Match() == null) {
builder.setLayer3Match(new Ipv4MatchBuilder()
.setIpv4Destination(IpConversionUtil.createPrefix(address, mask))
.build());
} else if (builder.getLayer3Match() instanceof Ipv4Match
- && Objects.isNull(((Ipv4Match) builder.getLayer3Match()).getIpv4Destination())) {
+ && ((Ipv4Match) builder.getLayer3Match()).getIpv4Destination() == null) {
builder.setLayer3Match(new Ipv4MatchBuilder((Ipv4Match) builder.getLayer3Match())
.setIpv4Destination(IpConversionUtil.createPrefix(address, mask))
.build());
private static void setArbitraryMatch(final MatchBuilder builder, final Ipv4Address address,
final byte[] mask) {
- if (Objects.isNull(builder.getLayer3Match())) {
+ if (builder.getLayer3Match() == null) {
builder.setLayer3Match(new Ipv4MatchArbitraryBitMaskBuilder()
.setIpv4DestinationAddressNoMask(address)
.setIpv4DestinationArbitraryBitmask(IpConversionUtil.createArbitraryBitMask(mask))
.build());
} else if (builder.getLayer3Match() instanceof Ipv4MatchArbitraryBitMask
- && Objects.isNull(((Ipv4MatchArbitraryBitMask) builder.getLayer3Match())
- .getIpv4DestinationAddressNoMask())) {
+ && ((Ipv4MatchArbitraryBitMask) builder.getLayer3Match()).getIpv4DestinationAddressNoMask() == null) {
builder.setLayer3Match(new Ipv4MatchArbitraryBitMaskBuilder((Ipv4MatchArbitraryBitMask) builder
.getLayer3Match())
.setIpv4DestinationAddressNoMask(address)
throwErrorOnMalformed(builder, "layer3Match", "ipv4DestinationAddressNoMask");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
import org.opendaylight.openflowjava.util.ByteBufUtils;
}
private static void setPrefixMatch(final MatchBuilder builder, final Ipv4Address address, final byte[] mask) {
- if (Objects.isNull(builder.getLayer3Match())) {
+ if (builder.getLayer3Match() == null) {
builder.setLayer3Match(new Ipv4MatchBuilder()
.setIpv4Source(IpConversionUtil.createPrefix(address, mask))
.build());
} else if (builder.getLayer3Match() instanceof Ipv4Match
- && Objects.isNull(((Ipv4Match) builder.getLayer3Match()).getIpv4Source())) {
+ && ((Ipv4Match) builder.getLayer3Match()).getIpv4Source() == null) {
builder.setLayer3Match(new Ipv4MatchBuilder((Ipv4Match) builder.getLayer3Match())
.setIpv4Source(IpConversionUtil.createPrefix(address, mask))
.build());
private static void setArbitraryMatch(final MatchBuilder builder, final Ipv4Address address,
final byte[] mask) {
- if (Objects.isNull(builder.getLayer3Match())) {
+ if (builder.getLayer3Match() == null) {
builder.setLayer3Match(new Ipv4MatchArbitraryBitMaskBuilder()
.setIpv4SourceAddressNoMask(address)
.setIpv4SourceArbitraryBitmask(IpConversionUtil.createArbitraryBitMask(mask))
.build());
} else if (builder.getLayer3Match() instanceof Ipv4MatchArbitraryBitMask
- && Objects.isNull(((Ipv4MatchArbitraryBitMask) builder.getLayer3Match())
- .getIpv4SourceAddressNoMask())) {
+ && ((Ipv4MatchArbitraryBitMask) builder.getLayer3Match()).getIpv4SourceAddressNoMask() == null) {
builder.setLayer3Match(new Ipv4MatchArbitraryBitMaskBuilder((Ipv4MatchArbitraryBitMask) builder
.getLayer3Match())
.setIpv4SourceAddressNoMask(address)
throwErrorOnMalformed(builder, "layer3Match", "ipv4SourceAddressNoMask");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
import org.opendaylight.openflowjava.util.ByteBufUtils;
}
private static void setPrefixMatch(final MatchBuilder builder, final Ipv6Address address, final byte[] mask) {
- if (Objects.isNull(builder.getLayer3Match())) {
+ if (builder.getLayer3Match() == null) {
builder.setLayer3Match(new Ipv6MatchBuilder()
.setIpv6Destination(IpConversionUtil.createPrefix(address, mask))
.build());
} else if (builder.getLayer3Match() instanceof Ipv6Match
- && Objects.isNull(((Ipv6Match) builder.getLayer3Match()).getIpv6Destination())) {
+ && ((Ipv6Match) builder.getLayer3Match()).getIpv6Destination() == null) {
builder.setLayer3Match(new Ipv6MatchBuilder((Ipv6Match) builder.getLayer3Match())
.setIpv6Destination(IpConversionUtil.createPrefix(address, mask))
.build());
}
}
- private static void setArbitraryMatch(final MatchBuilder builder, final Ipv6Address address,
- final byte[] mask) {
- if (Objects.isNull(builder.getLayer3Match())) {
+ private static void setArbitraryMatch(final MatchBuilder builder, final Ipv6Address address, final byte[] mask) {
+ if (builder.getLayer3Match() == null) {
builder.setLayer3Match(new Ipv6MatchArbitraryBitMaskBuilder()
.setIpv6DestinationAddressNoMask(address)
.setIpv6DestinationArbitraryBitmask(IpConversionUtil.createIpv6ArbitraryBitMask(mask))
.build());
} else if (builder.getLayer3Match() instanceof Ipv6MatchArbitraryBitMask
- && Objects.isNull(((Ipv6MatchArbitraryBitMask) builder.getLayer3Match())
- .getIpv6DestinationAddressNoMask())) {
+ && ((Ipv6MatchArbitraryBitMask) builder.getLayer3Match()).getIpv6DestinationAddressNoMask() == null) {
final Ipv6MatchArbitraryBitMask match = (Ipv6MatchArbitraryBitMask) builder.getLayer3Match();
builder.setLayer3Match(new Ipv6MatchArbitraryBitMaskBuilder(match)
.setIpv6DestinationAddressNoMask(address)
throwErrorOnMalformed(builder, "layer3Match", "ipv6DestinationAddressNoMask");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
extHeaderBuilder.setIpv6ExthdrMask(ByteUtil.bytesToUnsignedShort(mask));
}
- if (Objects.isNull(builder.getLayer3Match())) {
+ if (builder.getLayer3Match() == null) {
builder.setLayer3Match(new Ipv6MatchBuilder()
.setIpv6ExtHeader(extHeaderBuilder.build())
.build());
} else if (builder.getLayer3Match() instanceof Ipv6Match
- && Objects.isNull(((Ipv6Match) builder.getLayer3Match()).getIpv6ExtHeader())) {
+ && ((Ipv6Match) builder.getLayer3Match()).getIpv6ExtHeader() == null) {
final Ipv6Match match = (Ipv6Match) builder.getLayer3Match();
builder.setLayer3Match(new Ipv6MatchBuilder(match)
.setIpv6ExtHeader(extHeaderBuilder.build())
} else {
throwErrorOnMalformed(builder, "layer3Match", "ipv6ExtHeader");
}
-
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
ipv6labelBuilder.setFlabelMask(new Ipv6FlowLabel(ByteUtil.bytesToUnsignedInt(mask)));
}
- if (Objects.isNull(builder.getLayer3Match())) {
+ if (builder.getLayer3Match() == null) {
builder.setLayer3Match(new Ipv6MatchBuilder()
.setIpv6Label(ipv6labelBuilder.build())
.build());
} else if (builder.getLayer3Match() instanceof Ipv6Match
- && Objects.isNull(((Ipv6Match) builder.getLayer3Match()).getIpv6Label())) {
+ && ((Ipv6Match) builder.getLayer3Match()).getIpv6Label() == null) {
final Ipv6Match match = (Ipv6Match) builder.getLayer3Match();
builder.setLayer3Match(new Ipv6MatchBuilder(match)
.setIpv6Label(ipv6labelBuilder.build())
} else {
throwErrorOnMalformed(builder, "layer3Match", "ipv6Label");
}
-
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
processHeader(message);
final MacAddress address = OxmDeserializerHelper.convertMacAddress(message);
- if (Objects.isNull(builder.getLayer3Match())) {
+ if (builder.getLayer3Match() == null) {
builder.setLayer3Match(new Ipv6MatchBuilder()
.setIpv6NdSll(address)
.build());
} else if (builder.getLayer3Match() instanceof Ipv6Match
- && Objects.isNull(((Ipv6Match) builder.getLayer3Match()).getIpv6NdSll())) {
+ && ((Ipv6Match) builder.getLayer3Match()).getIpv6NdSll() == null) {
final Ipv6Match match = (Ipv6Match) builder.getLayer3Match();
builder.setLayer3Match(new Ipv6MatchBuilder(match)
.setIpv6NdSll(address)
} else {
throwErrorOnMalformed(builder, "layer3Match", "ipv6NdSll");
}
-
}
-
}
package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
processHeader(message);
final Ipv6Address address = ByteBufUtils.readIetfIpv6Address(message);
- if (Objects.isNull(builder.getLayer3Match())) {
+ if (builder.getLayer3Match() == null) {
builder.setLayer3Match(new Ipv6MatchBuilder()
.setIpv6NdTarget(address)
.build());
} else if (builder.getLayer3Match() instanceof Ipv6Match
- && Objects.isNull(((Ipv6Match) builder.getLayer3Match()).getIpv6NdTarget())) {
+ && ((Ipv6Match) builder.getLayer3Match()).getIpv6NdTarget() == null) {
final Ipv6Match match = (Ipv6Match) builder.getLayer3Match();
builder.setLayer3Match(new Ipv6MatchBuilder(match)
.setIpv6NdTarget(address)
} else {
throwErrorOnMalformed(builder, "layer3Match", "ipv6NdTarget");
}
-
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
processHeader(message);
final MacAddress address = OxmDeserializerHelper.convertMacAddress(message);
- if (Objects.isNull(builder.getLayer3Match())) {
+ if (builder.getLayer3Match() == null) {
builder.setLayer3Match(new Ipv6MatchBuilder()
.setIpv6NdTll(address)
.build());
} else if (builder.getLayer3Match() instanceof Ipv6Match
- && Objects.isNull(((Ipv6Match) builder.getLayer3Match()).getIpv6NdTll())) {
+ && ((Ipv6Match) builder.getLayer3Match()).getIpv6NdTll() == null) {
final Ipv6Match match = (Ipv6Match) builder.getLayer3Match();
builder.setLayer3Match(new Ipv6MatchBuilder(match)
.setIpv6NdTll(address)
} else {
throwErrorOnMalformed(builder, "layer3Match", "ipv6NdTll");
}
-
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
import org.opendaylight.openflowjava.util.ByteBufUtils;
}
private static void setPrefixMatch(final MatchBuilder builder, final Ipv6Address address, final byte[] mask) {
- if (Objects.isNull(builder.getLayer3Match())) {
+ if (builder.getLayer3Match() == null) {
builder.setLayer3Match(new Ipv6MatchBuilder()
.setIpv6Source(IpConversionUtil.createPrefix(address, mask))
.build());
} else if (builder.getLayer3Match() instanceof Ipv6Match
- && Objects.isNull(((Ipv6Match) builder.getLayer3Match()).getIpv6Source())) {
+ && ((Ipv6Match) builder.getLayer3Match()).getIpv6Source() == null) {
builder.setLayer3Match(new Ipv6MatchBuilder((Ipv6Match) builder.getLayer3Match())
.setIpv6Source(IpConversionUtil.createPrefix(address, mask))
.build());
private static void setArbitraryMatch(final MatchBuilder builder, final Ipv6Address address,
final byte[] mask) {
- if (Objects.isNull(builder.getLayer3Match())) {
+ if (builder.getLayer3Match() == null) {
builder.setLayer3Match(new Ipv6MatchArbitraryBitMaskBuilder()
.setIpv6SourceAddressNoMask(address)
.setIpv6SourceArbitraryBitmask(IpConversionUtil.createIpv6ArbitraryBitMask(mask))
.build());
} else if (builder.getLayer3Match() instanceof Ipv6MatchArbitraryBitMask
- && Objects.isNull(((Ipv6MatchArbitraryBitMask) builder.getLayer3Match())
- .getIpv6SourceAddressNoMask())) {
+ && ((Ipv6MatchArbitraryBitMask) builder.getLayer3Match()).getIpv6SourceAddressNoMask() == null) {
final Ipv6MatchArbitraryBitMask match = (Ipv6MatchArbitraryBitMask) builder.getLayer3Match();
builder.setLayer3Match(new Ipv6MatchArbitraryBitMaskBuilder(match)
.setIpv6SourceAddressNoMask(address)
throwErrorOnMalformed(builder, "layer3Match", "ipv6SourceAddressNoMask");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
import java.util.HashMap;
import java.util.Map;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistryInjector;
import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
final MatchEntryDeserializer entryDeserializer = entryRegistry.get(key);
- if (Objects.nonNull(entryDeserializer)) {
+ if (entryDeserializer != null) {
entryDeserializer.deserializeEntry(inBuffer, builder);
} else {
final OFDeserializer<MatchEntry> deserializer = registry.getDeserializer(key);
@Override
public void registerEntryDeserializer(MatchEntryDeserializerKey key, MatchEntryDeserializer deserializer) {
- if (Objects.isNull(key) || Objects.isNull(deserializer)) {
+ if (key == null || deserializer == null) {
throw new IllegalArgumentException("MatchEntryDeserializerKey or Deserializer is null");
}
@Override
public boolean unregisterEntryDeserializer(MatchEntryDeserializerKey key) {
- if (Objects.isNull(key)) {
+ if (key == null) {
throw new IllegalArgumentException("MatchEntryDeserializerKey is null");
}
- return Objects.nonNull(entryRegistry.remove(key));
+ return entryRegistry.remove(key) != null;
}
@Override
public void injectDeserializerRegistry(DeserializerRegistry deserializerRegistry) {
registry = deserializerRegistry;
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
import java.math.BigInteger;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Metadata;
metadataBuilder.setMetadataMask(new BigInteger(1, metaMask));
}
- if (Objects.isNull(metadata)) {
+ if (metadata == null) {
builder.setMetadata(metadataBuilder.build());
} else {
throwErrorOnMalformed(builder, "metadata");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder;
processHeader(message);
final short mplsBos = message.readUnsignedByte();
- if (Objects.isNull(builder.getProtocolMatchFields())) {
+ if (builder.getProtocolMatchFields() == null) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder()
.setMplsBos(mplsBos)
.build());
- } else if (Objects.isNull(builder.getProtocolMatchFields().getMplsBos())) {
+ } else if (builder.getProtocolMatchFields().getMplsBos() == null) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder(builder.getProtocolMatchFields())
.setMplsBos(mplsBos)
.build());
throwErrorOnMalformed(builder, "protocolMatchFields", "mplsBos");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder;
processHeader(message);
final long mplsLabel = message.readUnsignedInt();
- if (Objects.isNull(builder.getProtocolMatchFields())) {
+ if (builder.getProtocolMatchFields() == null) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder()
.setMplsLabel(mplsLabel)
.build());
- } else if (Objects.isNull(builder.getProtocolMatchFields().getMplsLabel())) {
+ } else if (builder.getProtocolMatchFields().getMplsLabel() == null) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder(builder.getProtocolMatchFields())
.setMplsLabel(mplsLabel)
.build());
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder;
processHeader(message);
final short mplsTc = message.readUnsignedByte();
- if (Objects.isNull(builder.getProtocolMatchFields())) {
+ if (builder.getProtocolMatchFields() == null) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder()
.setMplsTc(mplsTc)
.build());
- } else if (Objects.isNull(builder.getProtocolMatchFields().getMplsTc())) {
+ } else if (builder.getProtocolMatchFields().getMplsTc() == null) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder(builder.getProtocolMatchFields())
.setMplsTc(mplsTc)
.build());
throwErrorOnMalformed(builder, "protocolMatchFields", "mplsTc");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.PacketTypeMatchBuilder;
public class PacketTypeEntryDeserializer extends AbstractMatchEntryDeserializer {
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
-
- if (Objects.nonNull(builder.getPacketTypeMatch())) {
+ if (builder.getPacketTypeMatch() != null) {
throwErrorOnMalformed(builder, "packet-type");
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.protocol.match.fields.PbbBuilder;
pbbBuilder.setPbbMask((long) message.readUnsignedMedium());
}
- if (Objects.isNull(builder.getProtocolMatchFields())) {
+ if (builder.getProtocolMatchFields() == null) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder()
.setPbb(pbbBuilder.build())
.build());
- } else if (Objects.isNull(builder.getProtocolMatchFields().getPbb())) {
+ } else if (builder.getProtocolMatchFields().getPbb() == null) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder(builder.getProtocolMatchFields())
.setPbb(pbbBuilder.build())
.build());
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatch;
processHeader(message);
final int port = message.readUnsignedShort();
- if (Objects.isNull(builder.getLayer4Match())) {
+ if (builder.getLayer4Match() == null) {
builder.setLayer4Match(new SctpMatchBuilder()
.setSctpDestinationPort(new PortNumber(port))
.build());
} else if (builder.getLayer4Match() instanceof SctpMatch
- && Objects.isNull(((SctpMatch) builder.getLayer4Match()).getSctpDestinationPort())) {
+ && ((SctpMatch) builder.getLayer4Match()).getSctpDestinationPort() == null) {
builder.setLayer4Match(new SctpMatchBuilder((SctpMatch) builder.getLayer4Match())
.setSctpDestinationPort(new PortNumber(port))
.build());
throwErrorOnMalformed(builder, "layer4Match", "sctpDestinationPort");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatch;
processHeader(message);
final int port = message.readUnsignedShort();
- if (Objects.isNull(builder.getLayer4Match())) {
+ if (builder.getLayer4Match() == null) {
builder.setLayer4Match(new SctpMatchBuilder()
.setSctpSourcePort(new PortNumber(port))
.build());
} else if (builder.getLayer4Match() instanceof SctpMatch
- && Objects.isNull(((SctpMatch) builder.getLayer4Match()).getSctpSourcePort())) {
+ && ((SctpMatch) builder.getLayer4Match()).getSctpSourcePort() == null) {
builder.setLayer4Match(new SctpMatchBuilder((SctpMatch) builder.getLayer4Match())
.setSctpSourcePort(new PortNumber(port))
.build());
throwErrorOnMalformed(builder, "layer4Match", "sctpSourcePort");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch;
processHeader(message);
final int port = message.readUnsignedShort();
- if (Objects.isNull(builder.getLayer4Match())) {
+ if (builder.getLayer4Match() == null) {
builder.setLayer4Match(new TcpMatchBuilder()
.setTcpDestinationPort(new PortNumber(port))
.build());
} else if (builder.getLayer4Match() instanceof TcpMatch
- && Objects.isNull(((TcpMatch) builder.getLayer4Match()).getTcpDestinationPort())) {
+ && ((TcpMatch) builder.getLayer4Match()).getTcpDestinationPort() == null) {
builder.setLayer4Match(new TcpMatchBuilder((TcpMatch) builder.getLayer4Match())
.setTcpDestinationPort(new PortNumber(port))
.build());
throwErrorOnMalformed(builder, "layer4Match", "tcpDestinationPort");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.TcpFlagsMatchBuilder;
tcpFlagsBuilder.setTcpFlagsMask(message.readUnsignedShort());
}
- if (Objects.isNull(builder.getTcpFlagsMatch())) {
+ if (builder.getTcpFlagsMatch() == null) {
builder.setTcpFlagsMatch(tcpFlagsBuilder.build());
} else {
throwErrorOnMalformed(builder, "tcpFlagsMatch");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch;
processHeader(message);
final int port = message.readUnsignedShort();
- if (Objects.isNull(builder.getLayer4Match())) {
+ if (builder.getLayer4Match() == null) {
builder.setLayer4Match(new TcpMatchBuilder()
.setTcpSourcePort(new PortNumber(port))
.build());
} else if (builder.getLayer4Match() instanceof TcpMatch
- && Objects.isNull(((TcpMatch) builder.getLayer4Match()).getTcpSourcePort())) {
+ && ((TcpMatch) builder.getLayer4Match()).getTcpSourcePort() == null) {
builder.setLayer4Match(new TcpMatchBuilder((TcpMatch) builder.getLayer4Match())
.setTcpSourcePort(new PortNumber(port))
.build());
throwErrorOnMalformed(builder, "layer4Match", "tcpSource");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
import java.math.BigInteger;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.TunnelBuilder;
tunnelBuilder.setTunnelMask(new BigInteger(1, tunnelMask));
}
- if (Objects.isNull(builder.getTunnel())) {
+ if (builder.getTunnel() == null) {
builder.setTunnel(tunnelBuilder.build());
} else {
throwErrorOnMalformed(builder, "tunnel");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch;
processHeader(message);
final int port = message.readUnsignedShort();
- if (Objects.isNull(builder.getLayer4Match())) {
+ if (builder.getLayer4Match() == null) {
builder.setLayer4Match(new UdpMatchBuilder()
.setUdpDestinationPort(new PortNumber(port))
.build());
} else if (builder.getLayer4Match() instanceof UdpMatch
- && Objects.isNull(((UdpMatch) builder.getLayer4Match()).getUdpDestinationPort())) {
+ && ((UdpMatch) builder.getLayer4Match()).getUdpDestinationPort() == null) {
builder.setLayer4Match(new UdpMatchBuilder((UdpMatch) builder.getLayer4Match())
.setUdpDestinationPort(new PortNumber(port))
.build());
throwErrorOnMalformed(builder, "layer4Match", "udpDestinationPort");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch;
processHeader(message);
final int port = message.readUnsignedShort();
- if (Objects.isNull(builder.getLayer4Match())) {
+ if (builder.getLayer4Match() == null) {
builder.setLayer4Match(new UdpMatchBuilder()
.setUdpSourcePort(new PortNumber(port))
.build());
} else if (builder.getLayer4Match() instanceof UdpMatch
- && Objects.isNull(((UdpMatch) builder.getLayer4Match()).getUdpSourcePort())) {
+ && ((UdpMatch) builder.getLayer4Match()).getUdpSourcePort() == null) {
builder.setLayer4Match(new UdpMatchBuilder((UdpMatch) builder.getLayer4Match())
.setUdpSourcePort(new PortNumber(port))
.build());
throwErrorOnMalformed(builder, "layer4Match", "udpSourcePort");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
processHeader(message);
final short pcp = message.readUnsignedByte();
- if (Objects.isNull(builder.getVlanMatch())) {
+ if (builder.getVlanMatch() == null) {
builder.setVlanMatch(new VlanMatchBuilder()
.setVlanPcp(new VlanPcp(pcp))
.build());
- } else if (Objects.isNull(builder.getVlanMatch().getVlanPcp())) {
+ } else if (builder.getVlanMatch().getVlanPcp() == null) {
builder.setVlanMatch(new VlanMatchBuilder(builder.getVlanMatch())
.setVlanPcp(new VlanPcp(pcp))
.build());
throwErrorOnMalformed(builder, "vlanMatch", "vlanPcp");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
.setVlanId(new VlanId(0))
.setVlanIdPresent(true);
} else {
- final boolean vidPresent = (vlanVidValue & (1 << 12)) != 0;
+ final boolean vidPresent = (vlanVidValue & 1 << 12) != 0;
vlanIdBuilder
- .setVlanId(new VlanId((vidPresent ? vlanVidValue & ((1 << 12) - 1) : vlanVidValue)))
+ .setVlanId(new VlanId(vidPresent ? vlanVidValue & (1 << 12) - 1 : vlanVidValue))
.setVlanIdPresent(vidPresent);
}
- if (Objects.isNull(builder.getVlanMatch())) {
+ if (builder.getVlanMatch() == null) {
builder.setVlanMatch(new VlanMatchBuilder()
.setVlanId(vlanIdBuilder.build())
.build());
- } else if (Objects.isNull(builder.getVlanMatch().getVlanId())) {
+ } else if (builder.getVlanMatch().getVlanId() == null) {
builder.setVlanMatch(new VlanMatchBuilder(builder.getVlanMatch())
.setVlanId(vlanIdBuilder.build())
.build());
throwErrorOnMalformed(builder, "vlanMatch", "vlanVid");
}
}
-
}
* 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.openflowplugin.impl.protocol.deserialization.util;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
public static Action readAction(short version, ByteBuf message, DeserializerRegistry registry,
ActionPath path) {
int type = message.getUnsignedShort(message.readerIndex());
- Long expId = null;
+ final Long expId;
if (type == EncodeConstants.EXPERIMENTER_VALUE) {
expId = message.getUnsignedInt(message.readerIndex()
+ 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ } else {
+ expId = null;
}
try {
return deserializer.deserialize(message);
} catch (ClassCastException | IllegalStateException e) {
- final MessageCodeKey key = Objects.nonNull(expId)
- ? new ExperimenterActionDeserializerKey(version, expId)
- : new ActionDeserializerKey(version, type, expId);
+ final MessageCodeKey key = getCodeKey(version, type, expId);
final OFDeserializer<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203
.actions.grouping.Action> deserializer = registry.getDeserializer(key);
public static Action readActionHeader(short version, ByteBuf message, DeserializerRegistry registry,
ActionPath path) {
int type = message.getUnsignedShort(message.readerIndex());
- Long expId = null;
+ final Long expId;
if (type == EncodeConstants.EXPERIMENTER_VALUE) {
expId = message.getUnsignedInt(message.readerIndex()
+ 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ } else {
+ expId = null;
}
try {
return deserializer.deserializeHeader(message);
} catch (ClassCastException | IllegalStateException e) {
- final MessageCodeKey key = Objects.nonNull(expId)
- ? new ExperimenterActionDeserializerKey(version, expId)
- : new ActionDeserializerKey(version, type, expId);
+ final MessageCodeKey key = getCodeKey(version, type, expId);
final HeaderDeserializer<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203
.actions.grouping.Action> deserializer = registry.getDeserializer(key);
}
}
+ private static MessageCodeKey getCodeKey(short version, int type, Long expId) {
+ return expId != null ? new ExperimenterActionDeserializerKey(version, expId)
+ : new ActionDeserializerKey(version, type, null);
+ }
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer3Match())
+ return match.getLayer3Match() != null
&& match.getLayer3Match() instanceof ArpMatch
- && Objects.nonNull(((ArpMatch) match.getLayer3Match()).getArpOp());
+ && ((ArpMatch) match.getLayer3Match()).getArpOp() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowjava.util.ByteBufUtils;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer3Match())
+ return match.getLayer3Match() != null
&& match.getLayer3Match() instanceof ArpMatch
- && Objects.nonNull(((ArpMatch) match.getLayer3Match()).getArpSourceHardwareAddress());
+ && ((ArpMatch) match.getLayer3Match()).getArpSourceHardwareAddress() != null;
}
@Override
protected boolean getHasMask(Match match) {
- return Objects.nonNull(((ArpMatch) match.getLayer3Match()).getArpSourceHardwareAddress().getMask());
+ return ((ArpMatch) match.getLayer3Match()).getArpSourceHardwareAddress().getMask() != null;
}
@Override
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
import java.util.Iterator;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer3Match())
+ return match.getLayer3Match() != null
&& match.getLayer3Match() instanceof ArpMatch
- && Objects.nonNull(((ArpMatch) match.getLayer3Match()).getArpSourceTransportAddress());
+ && ((ArpMatch) match.getLayer3Match()).getArpSourceTransportAddress() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_INT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowjava.util.ByteBufUtils;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer3Match())
+ return match.getLayer3Match() != null
&& match.getLayer3Match() instanceof ArpMatch
- && Objects.nonNull(((ArpMatch) match.getLayer3Match()).getArpTargetHardwareAddress());
+ && ((ArpMatch) match.getLayer3Match()).getArpTargetHardwareAddress() != null;
}
@Override
protected boolean getHasMask(Match match) {
- return Objects.nonNull(((ArpMatch) match.getLayer3Match()).getArpTargetHardwareAddress().getMask());
+ return ((ArpMatch) match.getLayer3Match()).getArpTargetHardwareAddress().getMask() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.MAC_ADDRESS_LENGTH;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
import java.util.Iterator;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer3Match())
+ return match.getLayer3Match() != null
&& match.getLayer3Match() instanceof ArpMatch
- && Objects.nonNull(((ArpMatch) match.getLayer3Match()).getArpTargetTransportAddress());
+ && ((ArpMatch) match.getLayer3Match()).getArpTargetTransportAddress() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_INT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowjava.util.ByteBufUtils;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getEthernetMatch())
- && Objects.nonNull(match.getEthernetMatch().getEthernetDestination());
+ return match.getEthernetMatch() != null && match.getEthernetMatch().getEthernetDestination() != null;
}
@Override
protected boolean getHasMask(Match match) {
- return Objects.nonNull(match.getEthernetMatch().getEthernetDestination().getMask());
+ return match.getEthernetMatch().getEthernetDestination().getMask() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.MAC_ADDRESS_LENGTH;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowjava.util.ByteBufUtils;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getEthernetMatch())
- && Objects.nonNull(match.getEthernetMatch().getEthernetSource());
+ return match.getEthernetMatch() != null && match.getEthernetMatch().getEthernetSource() != null;
}
@Override
protected boolean getHasMask(Match match) {
- return Objects.nonNull(match.getEthernetMatch().getEthernetSource().getMask());
+ return match.getEthernetMatch().getEthernetSource().getMask() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.MAC_ADDRESS_LENGTH;
}
-
}
package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getEthernetMatch())
- && Objects.nonNull(match.getEthernetMatch().getEthernetType());
+ return match.getEthernetMatch() != null && match.getEthernetMatch().getEthernetType() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getIcmpv4Match())
- && Objects.nonNull(match.getIcmpv4Match().getIcmpv4Code());
+ return match.getIcmpv4Match() != null && match.getIcmpv4Match().getIcmpv4Code() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
}
-
}
package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getIcmpv4Match())
- && Objects.nonNull(match.getIcmpv4Match().getIcmpv4Type());
+ return match.getIcmpv4Match() != null && match.getIcmpv4Match().getIcmpv4Type() != null;
}
@Override
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getIcmpv6Match())
- && Objects.nonNull(match.getIcmpv6Match().getIcmpv6Code());
+ return match.getIcmpv6Match() != null && match.getIcmpv6Match().getIcmpv6Code() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getIcmpv6Match())
- && Objects.nonNull(match.getIcmpv6Match().getIcmpv6Type());
+ return match.getIcmpv6Match() != null && match.getIcmpv6Match().getIcmpv6Type() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getInPhyPort());
+ return match.getInPhyPort() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_INT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getInPort());
+ return match.getInPort() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_INT_IN_BYTES;
}
-
}
package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getIpMatch())
- && Objects.nonNull(match.getIpMatch().getIpDscp());
+ return match.getIpMatch() != null && match.getIpMatch().getIpDscp() != null;
}
@Override
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getIpMatch())
- && Objects.nonNull(match.getIpMatch().getIpEcn());
+ return match.getIpMatch() != null && match.getIpMatch().getIpEcn() != null;
}
@Override
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getIpMatch())
- && Objects.nonNull(match.getIpMatch().getIpProtocol());
+ return match.getIpMatch() != null && match.getIpMatch().getIpProtocol() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
import java.util.Iterator;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@Override
public boolean matchTypeCheck(Match match) {
if (isPrefix(match)) {
- return Objects.nonNull(match.getLayer3Match())
- && Objects.nonNull(((Ipv4Match) match.getLayer3Match()).getIpv4Destination());
+ return match.getLayer3Match() != null
+ && ((Ipv4Match) match.getLayer3Match()).getIpv4Destination() != null;
} else if (isArbitrary(match)) {
- return Objects.nonNull(match.getLayer3Match())
- && Objects.nonNull(((Ipv4MatchArbitraryBitMask) match.getLayer3Match())
- .getIpv4DestinationAddressNoMask());
+ return match.getLayer3Match() != null
+ && ((Ipv4MatchArbitraryBitMask) match.getLayer3Match()).getIpv4DestinationAddressNoMask() != null;
}
return false;
// Check if we have mask
return addressParts.hasNext() && Integer.parseInt(addressParts.next()) < 32;
} else if (isArbitrary(match)) {
- return Objects.nonNull(((Ipv4MatchArbitraryBitMask) match.getLayer3Match())
- .getIpv4DestinationArbitraryBitmask());
+ return ((Ipv4MatchArbitraryBitMask) match.getLayer3Match()).getIpv4DestinationArbitraryBitmask() != null;
}
return false;
protected int getValueLength() {
return EncodeConstants.SIZE_OF_INT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
import java.util.Iterator;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@Override
public boolean matchTypeCheck(Match match) {
if (isPrefix(match)) {
- return Objects.nonNull(match.getLayer3Match())
- && Objects.nonNull(((Ipv4Match) match.getLayer3Match()).getIpv4Source());
+ return match.getLayer3Match() != null
+ && ((Ipv4Match) match.getLayer3Match()).getIpv4Source() != null;
} else if (isArbitrary(match)) {
- return Objects.nonNull(match.getLayer3Match())
- && Objects.nonNull(((Ipv4MatchArbitraryBitMask) match.getLayer3Match())
- .getIpv4SourceAddressNoMask());
+ return match.getLayer3Match() != null
+ && ((Ipv4MatchArbitraryBitMask) match.getLayer3Match()).getIpv4SourceAddressNoMask() != null;
}
return false;
// Check if we have mask
return addressParts.hasNext() && Integer.parseInt(addressParts.next()) < 32;
} else if (isArbitrary(match)) {
- return Objects.nonNull(((Ipv4MatchArbitraryBitMask) match.getLayer3Match())
- .getIpv4SourceArbitraryBitmask());
+ return ((Ipv4MatchArbitraryBitMask) match.getLayer3Match()).getIpv4SourceArbitraryBitmask() != null;
}
return false;
protected int getValueLength() {
return EncodeConstants.SIZE_OF_INT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@Override
public boolean matchTypeCheck(Match match) {
if (isPrefix(match)) {
- return Objects.nonNull(match.getLayer3Match())
- && Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6Destination());
+ return match.getLayer3Match() != null
+ && ((Ipv6Match) match.getLayer3Match()).getIpv6Destination() != null;
} else if (isArbitrary(match)) {
-
- return Objects.nonNull(match.getLayer3Match())
- && Objects.nonNull(((Ipv6MatchArbitraryBitMask) match.getLayer3Match())
- .getIpv6DestinationAddressNoMask());
+ return match.getLayer3Match() != null
+ && ((Ipv6MatchArbitraryBitMask) match.getLayer3Match()).getIpv6DestinationAddressNoMask() != null;
}
return false;
@Override
protected boolean getHasMask(Match match) {
if (isPrefix(match)) {
- if (null != IpConversionUtil.hasIpv6Prefix(((Ipv6Match) match.getLayer3Match())
- .getIpv6Destination())) {
- return Objects.nonNull(IpConversionUtil
- .extractIpv6Prefix(((Ipv6Match) match.getLayer3Match()).getIpv6Destination()));
+ if (null != IpConversionUtil.hasIpv6Prefix(((Ipv6Match) match.getLayer3Match()).getIpv6Destination())) {
+ return IpConversionUtil.extractIpv6Prefix(
+ ((Ipv6Match) match.getLayer3Match()).getIpv6Destination()) != null;
}
} else if (isArbitrary(match)) {
- return Objects.nonNull(((Ipv6MatchArbitraryBitMask) match.getLayer3Match())
- .getIpv6DestinationArbitraryBitmask());
+ return ((Ipv6MatchArbitraryBitMask) match.getLayer3Match()).getIpv6DestinationArbitraryBitmask() != null;
}
return false;
protected int getValueLength() {
return EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer3Match())
+ return match.getLayer3Match() != null
&& match.getLayer3Match() instanceof Ipv6Match
- && Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6ExtHeader());
+ && ((Ipv6Match) match.getLayer3Match()).getIpv6ExtHeader() != null;
}
@Override
protected boolean getHasMask(Match match) {
- return Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6ExtHeader().getIpv6ExthdrMask());
+ return ((Ipv6Match) match.getLayer3Match()).getIpv6ExtHeader().getIpv6ExthdrMask() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer3Match())
+ return match.getLayer3Match() != null
&& match.getLayer3Match() instanceof Ipv6Match
- && Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6Label());
+ && ((Ipv6Match) match.getLayer3Match()).getIpv6Label() != null;
}
@Override
protected boolean getHasMask(Match match) {
- return Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6Label().getFlabelMask());
+ return ((Ipv6Match) match.getLayer3Match()).getIpv6Label().getFlabelMask() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_INT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer3Match())
+ return match.getLayer3Match() != null
&& match.getLayer3Match() instanceof Ipv6Match
- && Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6NdSll());
+ && ((Ipv6Match) match.getLayer3Match()).getIpv6NdSll() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.MAC_ADDRESS_LENGTH;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer3Match())
+ return match.getLayer3Match() != null
&& match.getLayer3Match() instanceof Ipv6Match
- && Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6NdTarget());
+ && ((Ipv6Match) match.getLayer3Match()).getIpv6NdTarget() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer3Match())
+ return match.getLayer3Match() != null
&& match.getLayer3Match() instanceof Ipv6Match
- && Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6NdTll());
+ && ((Ipv6Match) match.getLayer3Match()).getIpv6NdTll() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.MAC_ADDRESS_LENGTH;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@Override
public boolean matchTypeCheck(Match match) {
if (isPrefix(match)) {
- return Objects.nonNull(match.getLayer3Match())
- && Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6Source());
+ return match.getLayer3Match() != null && ((Ipv6Match) match.getLayer3Match()).getIpv6Source() != null;
} else if (isArbitrary(match)) {
- return Objects.nonNull(match.getLayer3Match())
- && Objects.nonNull(((Ipv6MatchArbitraryBitMask) match.getLayer3Match())
- .getIpv6SourceAddressNoMask());
+ return match.getLayer3Match() != null
+ && ((Ipv6MatchArbitraryBitMask) match.getLayer3Match()).getIpv6SourceAddressNoMask() != null;
}
return false;
protected boolean getHasMask(Match match) {
if (isPrefix(match)) {
if (null != IpConversionUtil.hasIpv6Prefix(((Ipv6Match) match.getLayer3Match()).getIpv6Source())) {
- return Objects.nonNull(IpConversionUtil
- .extractIpv6Prefix(((Ipv6Match) match.getLayer3Match()).getIpv6Source()));
+ return IpConversionUtil.extractIpv6Prefix(((Ipv6Match) match.getLayer3Match()).getIpv6Source()) != null;
}
} else if (isArbitrary(match)) {
- return Objects.nonNull(((Ipv6MatchArbitraryBitMask) match.getLayer3Match())
- .getIpv6SourceArbitraryBitmask());
+ return ((Ipv6MatchArbitraryBitMask) match.getLayer3Match()).getIpv6SourceArbitraryBitmask() != null;
}
return false;
protected int getValueLength() {
return EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import java.util.Objects;
import java.util.Optional;
import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
@Override
public void registerEntrySerializer(org.opendaylight.openflowplugin.api.openflow.protocol.serialization
.MatchEntrySerializerKey key, MatchEntrySerializer serializer) {
- if (Objects.isNull(key) || Objects.isNull(serializer)) {
+ if (key == null || serializer == null) {
throw new IllegalArgumentException("MatchEntrySerializerKey or Serializer is null");
}
@Override
public boolean unregisterEntrySerializer(org.opendaylight.openflowplugin.api.openflow.protocol.serialization
.MatchEntrySerializerKey key) {
- return Objects.nonNull(entryRegistry.remove(key));
+ return entryRegistry.remove(key) != null;
}
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getMetadata());
+ return match.getMetadata() != null;
}
@Override
protected boolean getHasMask(Match match) {
- return Objects.nonNull(match.getMetadata().getMetadataMask());
+ return match.getMetadata().getMetadataMask() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_LONG_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getProtocolMatchFields())
- && Objects.nonNull(match.getProtocolMatchFields().getMplsBos());
+ return match.getProtocolMatchFields() != null && match.getProtocolMatchFields().getMplsBos() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getProtocolMatchFields())
- && Objects.nonNull(match.getProtocolMatchFields().getMplsLabel());
+ return match.getProtocolMatchFields() != null && match.getProtocolMatchFields().getMplsLabel() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_INT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getProtocolMatchFields())
- && Objects.nonNull(match.getProtocolMatchFields().getMplsTc());
+ return match.getProtocolMatchFields() != null && match.getProtocolMatchFields().getMplsTc() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getPacketTypeMatch())
- && Objects.nonNull(match.getPacketTypeMatch().getPacketType());
+ return match.getPacketTypeMatch() != null && match.getPacketTypeMatch().getPacketType() != null;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getProtocolMatchFields())
- && Objects.nonNull(match.getProtocolMatchFields().getPbb());
+ return match.getProtocolMatchFields() != null && match.getProtocolMatchFields().getPbb() != null;
}
@Override
protected boolean getHasMask(Match match) {
- return Objects.nonNull(match.getProtocolMatchFields().getPbb().getPbbMask());
+ return match.getProtocolMatchFields().getPbb().getPbbMask() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_3_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer4Match())
+ return match.getLayer4Match() != null
&& match.getLayer4Match() instanceof SctpMatch
- && Objects.nonNull(((SctpMatch) match.getLayer4Match()).getSctpDestinationPort());
+ && ((SctpMatch) match.getLayer4Match()).getSctpDestinationPort() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer4Match())
+ return match.getLayer4Match() != null
&& match.getLayer4Match() instanceof SctpMatch
- && Objects.nonNull(((SctpMatch) match.getLayer4Match()).getSctpSourcePort());
+ && ((SctpMatch) match.getLayer4Match()).getSctpSourcePort() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer4Match())
+ return match.getLayer4Match() != null
&& match.getLayer4Match() instanceof TcpMatch
- && Objects.nonNull(((TcpMatch) match.getLayer4Match()).getTcpDestinationPort());
+ && ((TcpMatch) match.getLayer4Match()).getTcpDestinationPort() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
}
-
}
package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getTcpFlagsMatch())
- && Objects.nonNull(match.getTcpFlagsMatch().getTcpFlags());
+ return match.getTcpFlagsMatch() != null && match.getTcpFlagsMatch().getTcpFlags() != null;
}
@Override
protected boolean getHasMask(Match match) {
- return Objects.nonNull(match.getTcpFlagsMatch().getTcpFlagsMask());
+ return match.getTcpFlagsMatch().getTcpFlagsMask() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer4Match())
+ return match.getLayer4Match() != null
&& match.getLayer4Match() instanceof TcpMatch
- && Objects.nonNull(((TcpMatch) match.getLayer4Match()).getTcpSourcePort());
+ && ((TcpMatch) match.getLayer4Match()).getTcpSourcePort() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getTunnel())
- && Objects.nonNull(match.getTunnel().getTunnelId());
+ return match.getTunnel() != null && match.getTunnel().getTunnelId() != null;
}
@Override
protected boolean getHasMask(Match match) {
- return Objects.nonNull(match.getTunnel().getTunnelMask());
+ return match.getTunnel().getTunnelMask() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_LONG_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
import java.util.Iterator;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer3Match())
+ return match.getLayer3Match() != null
&& match.getLayer3Match() instanceof TunnelIpv4Match
- && Objects.nonNull(((TunnelIpv4Match) match.getLayer3Match()).getTunnelIpv4Destination());
+ && ((TunnelIpv4Match) match.getLayer3Match()).getTunnelIpv4Destination() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_INT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
import java.util.Iterator;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer3Match())
+ return match.getLayer3Match() != null
&& match.getLayer3Match() instanceof TunnelIpv4Match
- && Objects.nonNull(((TunnelIpv4Match) match.getLayer3Match()).getTunnelIpv4Source());
+ && ((TunnelIpv4Match) match.getLayer3Match()).getTunnelIpv4Source() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_INT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer4Match())
+ return match.getLayer4Match() != null
&& match.getLayer4Match() instanceof UdpMatch
- && Objects.nonNull(((UdpMatch) match.getLayer4Match()).getUdpDestinationPort());
+ && ((UdpMatch) match.getLayer4Match()).getUdpDestinationPort() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getLayer4Match())
+ return match.getLayer4Match() != null
&& match.getLayer4Match() instanceof UdpMatch
- && Objects.nonNull(((UdpMatch) match.getLayer4Match()).getUdpSourcePort());
+ && ((UdpMatch) match.getLayer4Match()).getUdpSourcePort() != null;
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
}
-
}
package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getVlanMatch())
- && Objects.nonNull(match.getVlanMatch().getVlanPcp());
+ return match.getVlanMatch() != null && match.getVlanMatch().getVlanPcp() != null;
}
@Override
* 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.openflowplugin.impl.protocol.serialization.match;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
final org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId vlanId =
match.getVlanMatch().getVlanId().getVlanId();
- int vlanVidValue = Objects.nonNull(vlanId) ? vlanId.getValue() : 0;
+ int vlanVidValue = vlanId != null ? vlanId.getValue() : 0;
if (Boolean.TRUE.equals(match.getVlanMatch().getVlanId().isVlanIdPresent())) {
short cfi = 1 << 12;
@Override
public boolean matchTypeCheck(Match match) {
- return Objects.nonNull(match.getVlanMatch())
- && Objects.nonNull(match.getVlanMatch().getVlanId());
+ return match.getVlanMatch() != null && match.getVlanMatch().getVlanId() != null;
}
@Override
protected boolean getHasMask(Match match) {
final VlanId vlanId = match.getVlanMatch().getVlanId();
return Boolean.TRUE.equals(vlanId.isVlanIdPresent())
- && (Objects.isNull(vlanId.getVlanId()) || vlanId.getVlanId().getValue() == 0);
+ && (vlanId.getVlanId() == null || vlanId.getVlanId().getValue() == 0);
}
@Override
protected int getValueLength() {
return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
}
-
}
* 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.openflowplugin.impl.protocol.serialization.messages;
import io.netty.buffer.ByteBuf;
import java.util.Map;
-import java.util.Objects;
import java.util.Optional;
import java.util.WeakHashMap;
import org.opendaylight.openflowjava.util.ByteBufUtils;
}
private static void serializePacketInMask(final PacketInMask mask, final ByteBuf outBuffer) {
- if (Objects.isNull(mask)) {
+ if (mask == null) {
return;
}
}
private static void serializePortStatusMask(final PortStatusMask mask, final ByteBuf outBuffer) {
- if (Objects.isNull(mask)) {
+ if (mask == null) {
return;
}
}
private static void serializeFlowRemovedMask(final FlowRemovedMask mask, final ByteBuf outBuffer) {
- if (Objects.isNull(mask)) {
+ if (mask == null) {
return;
}
* 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.openflowplugin.impl.protocol.serialization.messages;
import com.google.common.base.MoreObjects;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import java.util.Optional;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
}
private void serializeBands(final MeterBandHeaders meterBandHeaders, final ByteBuf outBuffer) {
- if (Objects.nonNull(meterBandHeaders) && Objects.nonNull(meterBandHeaders.getMeterBandHeader())) {
+ if (meterBandHeaders != null && meterBandHeaders.getMeterBandHeader() != null) {
meterBandHeaders.getMeterBandHeader().forEach(meterBandHeader ->
Optional.ofNullable(meterBandHeader.getMeterBandTypes())
.flatMap(m -> Optional.ofNullable(m.getFlags()))
* 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.openflowplugin.impl.protocol.serialization.messages;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableMap;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil;
private static final byte PADDING_IN_PORT_MOD_MESSAGE_01 = 4;
private static final byte PADDING_IN_PORT_MOD_MESSAGE_02 = 2;
private static final byte PADDING_IN_PORT_MOD_MESSAGE_03 = 4;
- private static final int DEFAULT_PORT_CONFIG_MASK = createPortConfigBitMask(
+ private static final Integer DEFAULT_PORT_CONFIG_MASK = createPortConfigBitMask(
new PortConfig(true, true, true, true));
@Override
}
private static Integer createPortConfigBitMask(final PortConfig config) {
- return Objects.isNull(config) ? null : ByteBufUtils.fillBitMaskFromMap(ImmutableMap
+ return config == null ? null : ByteBufUtils.fillBitMaskFromMap(ImmutableMap
.<Integer, Boolean>builder()
.put(0, config.isPORTDOWN())
.put(2, config.isNORECV())
import com.google.common.base.Preconditions;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
: MultipartRequestExperimenter.class.equals(clazz) ? MultipartType.OFPMPEXPERIMENTER
: null;
- if (Objects.isNull(multipartType)) {
+ if (multipartType == null) {
throw new IllegalArgumentException(clazz.toString() + " is not valid multipart type");
}
* 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.openflowplugin.impl.protocol.serialization.multipart;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.multipart.request.multipart.request.body.MultipartRequestPortStats;
public class MultipartRequestPortStatsSerializer implements OFSerializer<MultipartRequestPortStats> {
-
private static final byte PADDING_IN_MULTIPART_REQUEST_PORTSTATS_BODY = 4;
@Override
public void serialize(final MultipartRequestPortStats multipartRequestPortStats, final ByteBuf byteBuf) {
- if (Objects.isNull(multipartRequestPortStats.getNodeConnectorId())) {
+ if (multipartRequestPortStats.getNodeConnectorId() == null) {
byteBuf.writeInt(OFConstants.OFPP_ANY.intValue());
} else {
byteBuf.writeInt(InventoryDataServiceUtil
byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_PORTSTATS_BODY);
}
-
}
* 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.openflowplugin.impl.protocol.serialization.multipart;
import com.google.common.base.MoreObjects;
import io.netty.buffer.ByteBuf;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
@Override
public void serialize(final MultipartRequestQueueStats multipartRequestQueueStats, final ByteBuf byteBuf) {
- if (Objects.isNull(multipartRequestQueueStats.getNodeConnectorId())) {
+ if (multipartRequestQueueStats.getNodeConnectorId() == null) {
byteBuf.writeInt(OFConstants.OFPP_ANY.intValue());
} else {
byteBuf.writeInt(InventoryDataServiceUtil
.firstNonNull(multipartRequestQueueStats.getQueueId(), new QueueId(OFConstants.OFPQ_ALL))
.getValue().intValue());
}
-
}
@Override
public void store(final FlowRegistryKey flowRegistryKey) {
- if (Objects.isNull(retrieveDescriptor(flowRegistryKey))) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Flow descriptor for flow hash : {} not found, generating alien flow ID",
- flowRegistryKey.toString());
- }
+ if (retrieveDescriptor(flowRegistryKey) == null) {
+ LOG.debug("Flow descriptor for flow hash : {} not found, generating alien flow ID", flowRegistryKey);
// We do not found flow in flow registry, that means it do not have any ID already assigned, so we need
// to generate new alien flow ID here.
* 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.openflowplugin.impl.role;
import com.google.common.util.concurrent.FutureCallback;
import io.netty.util.TimerTask;
import java.util.Collection;
import java.util.HashSet;
-import java.util.Objects;
import java.util.concurrent.CancellationException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
private void changeLastRoleFuture(final ListenableFuture<RpcResult<SetRoleOutput>> newFuture) {
slaveTask.cancel();
lastRoleFuture.getAndUpdate(lastFuture -> {
- if (Objects.nonNull(lastFuture) && !lastFuture.isCancelled() && !lastFuture.isDone()) {
+ if (lastFuture != null && !lastFuture.isCancelled() && !lastFuture.isDone()) {
lastFuture.cancel(true);
}
package org.opendaylight.openflowplugin.impl.services;
import java.util.List;
-import java.util.Objects;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
import org.opendaylight.openflowplugin.api.openflow.device.handlers.MultiMsgCollector;
@Override
@SuppressWarnings("unchecked")
public void onSuccess(final OfHeader result) {
- if (Objects.isNull(result)) {
+ if (result == null) {
LOG.info("Response received was null.");
collector.endCollecting(getEventIdentifier());
return;
import com.google.common.util.concurrent.Service;
import java.util.Collections;
import java.util.List;
-import java.util.Objects;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceRegistry;
private final MultipartWriterProvider statisticsWriterProvider;
private final DeviceRegistry deviceRegistry;
private volatile Service.State gatheringState = Service.State.NEW;
- private ConvertorExecutor convertorExecutor;
+ private final ConvertorExecutor convertorExecutor;
public AbstractMultipartRequestOnTheFlyCallback(final RequestContext<List<T>> context, Class<?> requestType,
final DeviceContext deviceContext,
@Override
@SuppressWarnings({"unchecked", "checkstyle:IllegalCatch"})
public void onSuccess(final OfHeader result) {
- if (Objects.isNull(result)) {
+ if (result == null) {
LOG.warn("Response received was null.");
if (!Service.State.TERMINATED.equals(gatheringState)) {
-/**
+/*
* Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import java.math.BigInteger;
-import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
LOG.trace("Handling general service call");
final RequestContext<O> requestContext = requestContextStack.createRequestContext();
- if (Objects.isNull(requestContext)) {
+ if (requestContext == null) {
LOG.trace("Request context refused.");
getMessageSpy().spyMessage(AbstractService.class, MessageSpy.StatisticsGroup.TO_SWITCH_DISREGARDED);
return Futures.immediateFuture(RpcResultBuilder
.build());
}
- if (Objects.isNull(requestContext.getXid())) {
+ if (requestContext.getXid() == null) {
getMessageSpy().spyMessage(requestContext.getClass(),
MessageSpy.StatisticsGroup.TO_SWITCH_RESERVATION_REJECTED);
return RequestContextUtil
final OutboundQueue outboundQueue =
getDeviceContext().getPrimaryConnectionContext().getOutboundQueueProvider();
- if (Objects.nonNull(isComplete)) {
+ if (isComplete != null) {
outboundQueue.commitEntry(xid.getValue(),
request,
createCallback(requestContext, requestType), isComplete);
* 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.openflowplugin.impl.services.multilayer;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.util.concurrent.SettableFuture;
import java.util.ArrayList;
import java.util.List;
-import java.util.Objects;
import javax.annotation.Nonnull;
import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
final ConverterMessageToOFJava<ExperimenterMessageOfChoice, ExperimenterDataOfChoice,
ConvertorData> messageConverter = getExtensionConverterProvider().getMessageConverter(key);
- if (Objects.isNull(messageConverter)) {
+ if (messageConverter == null) {
throw new ServiceException(new ConverterNotFoundException(key.toString()));
}
* 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.openflowplugin.impl.services.multilayer;
import java.util.List;
-import java.util.Objects;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
@Override
protected boolean isReqMore(T result) {
final MultipartRequestFlags flags = ((MultipartReply) result).getFlags();
- return Objects.nonNull(flags) && flags.isOFPMPFREQMORE();
+ return flags != null && flags.isOFPMPFREQMORE();
}
}
* 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.openflowplugin.impl.services.sal;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
-import java.util.Objects;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.impl.services.singlelayer.SingleLayerGetAsyncConfigService;
@Override
public ListenableFuture<RpcResult<GetAsyncOutput>> getAsync(GetAsyncInput input) {
return Futures.transform(getAsyncConfigService.handleServiceCall(input), result ->
- Objects.nonNull(result) && result.isSuccessful()
+ result != null && result.isSuccessful()
? RpcResultBuilder.success(new GetAsyncOutputBuilder(result.getResult())).build()
: RpcResultBuilder.<GetAsyncOutput>failed().build(),
MoreExecutors.directExecutor());
-/**
+/*
* Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
import com.google.common.util.concurrent.SettableFuture;
import java.util.ArrayList;
import java.util.List;
-import java.util.Objects;
import javax.annotation.Nonnull;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
if (rpcResult.isSuccessful()) {
final FlowDescriptor flowDescriptor;
- if (Objects.nonNull(input.getFlowRef())) {
+ if (input.getFlowRef() != null) {
final FlowId flowId = input.getFlowRef().getValue().firstKeyOf(Flow.class).getId();
flowDescriptor = FlowDescriptorFactory.create(input.getTableId(), flowId);
deviceContext.getDeviceFlowRegistry().storeDescriptor(flowRegistryKey, flowDescriptor);
FlowRegistryKeyFactory.create(deviceContext.getDeviceInfo().getVersion(), updated);
final FlowDescriptor origFlowDescriptor = deviceFlowRegistry.retrieveDescriptor(origFlowRegistryKey);
- final boolean isUpdate = Objects.nonNull(origFlowDescriptor);
+ final boolean isUpdate = origFlowDescriptor != null;
final FlowDescriptor updatedFlowDescriptor;
- if (Objects.nonNull(input.getFlowRef())) {
+ if (input.getFlowRef() != null) {
updatedFlowDescriptor =
FlowDescriptorFactory.create(updated.getTableId(),
input.getFlowRef().getValue().firstKeyOf(Flow.class).getId());
* 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.openflowplugin.impl.statistics;
import com.google.common.annotations.VisibleForTesting;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-
import org.opendaylight.mdsal.binding.api.TransactionChainClosedException;
import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
import org.opendaylight.openflowplugin.api.ConnectionException;
StatisticsGatheringUtils.markDeviceStateSnapshotStart(deviceInfo, deviceContext);
// recreate gathering future if it should be recreated
- final ListenableFuture<Boolean> lastDataGathering =
- Objects.isNull(future) || future.isCancelled() || future.isDone() ? Futures
- .immediateFuture(Boolean.TRUE) : future;
+ final ListenableFuture<Boolean> lastDataGathering = future == null || future.isCancelled()
+ || future.isDone() ? Futures.immediateFuture(Boolean.TRUE) : future;
// build statistics gathering future
final ListenableFuture<Boolean> newDataGathering = collectingStatType.stream()
private void cancelLastDataGathering() {
final ListenableFuture<Boolean> future = lastDataGatheringRef.getAndSet(null);
- if (Objects.nonNull(future) && !future.isDone() && !future.isCancelled()) {
+ if (future != null && !future.isDone() && !future.isCancelled()) {
future.cancel(true);
}
}
import java.util.Collections;
import java.util.Date;
import java.util.List;
-import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicBoolean;
// TODO: in case the result value is null then multipart data probably got processed
// TODO: on the fly. This contract should by clearly stated and enforced.
// TODO: Now simple true value is returned
- if (Objects.nonNull(rpcResult.getResult()) && !rpcResult.getResult().isEmpty()) {
+ if (rpcResult.getResult() != null && !rpcResult.getResult().isEmpty()) {
final List<DataContainer> allMultipartData = rpcResult.getResult().stream()
.map(reply -> MultipartReplyTranslatorUtil
.translate(reply, deviceInfo, convertorExecutor, null))
*/
package org.opendaylight.openflowplugin.impl.translator;
-import java.util.Objects;
import java.util.Optional;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
import org.opendaylight.openflowplugin.api.openflow.device.MessageTranslator;
.setPriority(input.getPriority())
.setTableId(translateTableId(input));
- if (Objects.nonNull(input.getReason())) {
+ if (input.getReason() != null) {
flowRemovedBld.setReason(translateReason(input));
}
* 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.openflowplugin.impl.util;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Locale;
-import java.util.Objects;
import javax.annotation.Nullable;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
*/
@Nullable
public static Uri normalizeProtocolAgnosticPort(@Nullable final Uri port, final short protocolVersion) {
- if (Objects.isNull(port)) {
+ if (port == null) {
return null;
}
*/
@Nullable
public static Ipv6Prefix normalizeIpv6Prefix(@Nullable final Ipv6Prefix ipv6Prefix) {
- if (Objects.isNull(ipv6Prefix)) {
+ if (ipv6Prefix == null) {
return null;
}
@Nullable
public static Ipv6Prefix normalizeIpv6Arbitrary(@Nullable final Ipv6Address ipv6Address,
@Nullable final Ipv6ArbitraryMask ipv4Mask) {
- if (Objects.isNull(ipv6Address)) {
+ if (ipv6Address == null) {
return null;
}
@Nullable
public static Ipv6Address normalizeIpv6AddressWithoutMask(@Nullable final Ipv6Address ipv6Address) {
final Ipv6Prefix ipv6Prefix = normalizeIpv6Arbitrary(ipv6Address, null);
- return Objects.nonNull(ipv6Prefix)
- ? new Ipv6Address(ipv6Prefix.getValue().split(PREFIX_SEPARATOR)[0])
- : null;
+ return ipv6Prefix == null ? null : new Ipv6Address(ipv6Prefix.getValue().split(PREFIX_SEPARATOR)[0]);
}
/**
*/
@Nullable
public static Ipv4Prefix normalizeIpv4Prefix(@Nullable final Ipv4Prefix ipv4Prefix) {
- if (Objects.isNull(ipv4Prefix)) {
+ if (ipv4Prefix == null) {
return null;
}
@Nullable
public static Ipv4Prefix normalizeIpv4Arbitrary(@Nullable final Ipv4Address ipv4Address,
@Nullable final DottedQuad ipv4Mask) {
- if (Objects.isNull(ipv4Address)) {
+ if (ipv4Address == null) {
return null;
}
public static Ipv4Prefix normalizeIpv4Address(@Nullable final byte[] address, @Nullable final byte[] mask) {
final String addressPrefix = normalizeInetAddressWithMask(normalizeIpAddress(address, mask), mask);
- if (Objects.isNull(addressPrefix)) {
+ if (addressPrefix == null) {
return null;
}
public static Ipv6Prefix normalizeIpv6Address(@Nullable final byte[] address, @Nullable final byte[] mask) {
final String addressPrefix = normalizeInetAddressWithMask(normalizeIpAddress(address, mask), mask);
- if (Objects.isNull(addressPrefix)) {
+ if (addressPrefix == null) {
return null;
}
*/
@Nullable
public static InetAddress normalizeIpAddress(@Nullable final byte[] address, @Nullable final byte[] mask) {
- if (Objects.isNull(address)) {
+ if (address == null) {
return null;
}
final byte[] result = new byte[address.length];
for (int i = 0; i < address.length; i++) {
- result[i] = Objects.nonNull(mask)
- ? (byte) (address[i] & mask[i])
- : address[i];
+ result[i] = mask != null ? (byte) (address[i] & mask[i]) : address[i];
}
try {
@Nullable
public static String normalizeInetAddressWithMask(@Nullable final InetAddress address,
@Nullable final byte[] mask) {
- if (Objects.isNull(address)) {
+ if (address == null) {
return null;
}
return address.getHostAddress()
- + (Objects.nonNull(mask)
- ? PREFIX_SEPARATOR + String.valueOf(IpConversionUtil.countBits(mask))
- : "");
+ + (mask == null ? "" : PREFIX_SEPARATOR + String.valueOf(IpConversionUtil.countBits(mask)));
}
/**
*/
@Nullable
public static MacAddress normalizeMacAddress(@Nullable final MacAddress macAddress) {
- if (Objects.isNull(macAddress)) {
- return null;
- }
-
- return new MacAddress(macAddress.getValue().toLowerCase(Locale.ROOT));
+ return macAddress == null ? null : new MacAddress(macAddress.getValue().toLowerCase(Locale.ROOT));
}
/**
public static MacAddress normalizeMacAddressMask(@Nullable final MacAddress macAddress) {
final MacAddress normalizedMacAddress = normalizeMacAddress(macAddress);
- if (Objects.isNull(normalizedMacAddress)) {
+ if (normalizedMacAddress == null) {
return null;
}
return normalizedMacAddress;
}
-
}
* 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.openflowplugin.impl.util;
import com.google.common.collect.ImmutableMap;
import java.util.List;
import java.util.Map;
-import java.util.Objects;
import java.util.Optional;
import java.util.function.Function;
import javax.annotation.Nonnull;
public static MatchV10Builder createEmptyV10Match() {
- Short zeroShort = Short.valueOf("0");
+ Short zeroShort = 0;
Integer zeroInteger = 0;
MatchV10Builder matchV10Builder = new MatchV10Builder();
matchV10Builder.setDlDst(ZERO_MAC_ADDRESS);
@Nullable
public static <T extends Match> T transformMatch(@Nullable final Match match,
@Nonnull final Class<T> implementedInterface) {
- if (Objects.isNull(match)) {
+ if (match == null) {
return null;
}
}
final Function<Match, Match> matchMatchFunction = TRANSFORMERS.get(implementedInterface);
-
- if (Objects.isNull(matchMatchFunction)) {
- return null;
- }
-
- return implementedInterface.cast(matchMatchFunction.apply(match));
+ return matchMatchFunction == null ? null : implementedInterface.cast(matchMatchFunction.apply(match));
}
private static Optional<List<ExtensionList>> resolveExtensions(final Match match) {
-/**
+/*
* Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
*/
package org.opendaylight.openflowplugin.openflow.md.core.extension;
-import java.util.Objects;
import org.opendaylight.openflowjava.protocol.api.keys.ActionSerializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterActionSerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action alienAction = null;
final ExtensionConverterProvider extensionConvertorProvider = OFSessionUtil.getExtensionConvertorProvider();
- if (Objects.isNull(extensionConvertorProvider)) {
+ if (extensionConvertorProvider == null) {
return null;
}
-/**
+/*
* Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import java.util.Objects;
import java.util.Optional;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
public final class MatchExtensionHelper {
- private static final Logger LOG = LoggerFactory
- .getLogger(MatchExtensionHelper.class);
+ private static final Logger LOG = LoggerFactory.getLogger(MatchExtensionHelper.class);
private MatchExtensionHelper() {
throw new IllegalAccessError("singleton enforcement");
final ExtensionListBuilder extBuilder = processExtension(matchEntry, ofVersion, matchPath);
- if (Objects.isNull(extBuilder)) {
- LOG.warn("Convertor for {} for version {} with match path {} not found.",
- matchEntry.toString(),
- ofVersion,
- matchPath.name());
- }
-
final GeneralAugMatchNodesNodeTableFlowBuilder builder = Optional
.ofNullable(matchBuilder.augmentation(GeneralAugMatchNodesNodeTableFlow.class))
.map(GeneralAugMatchNodesNodeTableFlowBuilder::new)
.orElse(new GeneralAugMatchNodesNodeTableFlowBuilder().setExtensionList(new ArrayList<>()));
- builder.getExtensionList().add(extBuilder.build());
+ if (extBuilder != null) {
+ builder.getExtensionList().add(extBuilder.build());
+ } else {
+ LOG.warn("Convertor for {} for version {} with match path {} not found.",
+ matchEntry, ofVersion, matchPath.name());
+ }
+
matchBuilder.addAugmentation(GeneralAugMatchNodesNodeTableFlow.class, builder.build());
}
* 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.openflowplugin.openflow.md.core.sal.convertor;
import com.google.common.annotations.VisibleForTesting;
import java.util.Collections;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Stream;
final Map<Class<?>, Convertor<?, ?, ? extends ConvertorData>> convertorsForVersion =
convertors.get(version);
- if (Objects.nonNull(convertorsForVersion)) {
+ if (convertorsForVersion != null) {
for (final Class<?> type : convertor.getTypes()) {
final Convertor<?, ?, ? extends ConvertorData> result = convertorsForVersion.get(type);
- if (Objects.isNull(result)) {
+ if (result == null) {
convertor.setConvertorExecutor(this);
convertorsForVersion.put(type, convertor);
LOG.debug("{} for version {} is now converted by {}", type, version, convertor);
public <F, T, D extends ConvertorData> Optional<T> convert(final F source, final D data) {
Optional<T> result = Optional.empty();
- if (Objects.isNull(source)) {
+ if (source == null) {
LOG.trace("Cannot extract type from null source");
return result;
}
final Class<?> type = source instanceof DataContainer ? ((DataContainer) source).getImplementedInterface()
: source.getClass();
- if (Objects.isNull(type)) {
+ if (type == null) {
LOG.warn("Cannot extract type from {}, because getImplementedInterface() returns null", source);
return result;
}
public <F, T, D extends ConvertorData> Optional<T> convert(final Collection<F> source, final D data) {
Optional<T> result = Optional.empty();
- if (Objects.isNull(source)) {
+ if (source == null) {
LOG.trace("Cannot extract type from null source");
return result;
}
final Class<?> type = first instanceof DataContainer ? ((DataContainer) first).getImplementedInterface()
: first.getClass();
- if (Objects.isNull(type)) {
+ if (type == null) {
LOG.warn("Cannot extract type from {}, because getImplementedInterface() returns null", source);
return result;
}
- return findConvertor(data.getVersion(), type)
- .map(convertor -> (T)convertor.convert(source, data));
+ return findConvertor(data.getVersion(), type).map(convertor -> (T)convertor.convert(source, data));
}
/**
Optional<Convertor> convertor = Optional.empty();
- if (Objects.nonNull(convertorsForVersion)) {
+ if (convertorsForVersion != null) {
convertor = Optional.ofNullable(convertorsForVersion.get(type));
if (!convertor.isPresent()) {
* 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.openflowplugin.openflow.md.core.sal.convertor;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.MoreObjects;
import java.util.Collection;
import java.util.Collections;
-import java.util.Objects;
import java.util.Set;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.Convertor;
private static PortConfig maskPortConfigFields(
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig configData) {
- if (Objects.isNull(configData)) {
+ if (configData == null) {
return null;
}
private static PortConfigV10 maskPortConfigV10Fields(
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig configData) {
- if (Objects.isNull(configData)) {
+ if (configData == null) {
return null;
}
* 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.openflowplugin.openflow.md.core.sal.convertor.common;
import java.util.Map;
-import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
Optional<T> result = Optional.empty();
final short version = data != null ? data.getVersion() : OFP_VERSION_ALL;
- if (Objects.isNull(source)) {
+ if (source == null) {
LOG.trace("Failed to convert null for version {}", version);
return result;
}
final ConvertorCase<?, T, D> processorCase = caseOptional.orElse(defaultCase);
- if (Objects.nonNull(processorCase)) {
+ if (processorCase != null) {
result = processorCase.processRaw(source, data, convertorExecutor);
if (processorCase.isErrorOnEmpty() && !result.isPresent()) {
import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
flowStats.getMatchV10(), data);
if (matchBuilderOptional.isPresent()) {
- if (Objects.nonNull(matchBuilderOptional.get().getIpMatch())) {
+ if (matchBuilderOptional.get().getIpMatch() != null) {
ipProtocol = matchBuilderOptional.get().getIpMatch().getIpProtocol();
}