*/
package org.opendaylight.openflowplugin.api.openflow.protocol.deserialization;
-import java.util.Objects;
-
import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterDeserializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
public class MessageCodeExperimenterKey extends MessageCodeKey implements ExperimenterDeserializerKey {
- private Long experimenterId;
+ private final Long experimenterId;
/**
* Constructor.
@Override
public int hashCode() {
final int prime = 31;
- return prime * super.hashCode() + (Objects.isNull(experimenterId) ? 0 : experimenterId.intValue());
+ return prime * super.hashCode() + (experimenterId == null ? 0 : experimenterId.intValue());
}
@Override
.flatMap(flowCapableNodeOptional
-> com.google.common.base.Optional.fromJavaUtil(flowCapableNodeOptional).asSet().stream())
.filter(Objects::nonNull)
- .filter(flowCapableNode -> Objects.nonNull(flowCapableNode.getTable()))
+ .filter(flowCapableNode -> flowCapableNode.getTable() != null)
.flatMap(flowCapableNode -> flowCapableNode.getTable().stream())
.filter(Objects::nonNull)
- .filter(table -> Objects.nonNull(table.getFlow()))
+ .filter(table -> table.getFlow() != null)
.flatMap(table -> table.getFlow().stream())
.filter(Objects::nonNull)
.count();
public void onSuccess(Optional<FlowCapableNode> result) {
result.map(Collections::singleton).orElse(Collections.emptySet()).stream()
.filter(Objects::nonNull)
- .filter(flowCapableNode -> Objects.nonNull(flowCapableNode.getTable()))
+ .filter(flowCapableNode -> flowCapableNode.getTable() != null)
.flatMap(flowCapableNode -> flowCapableNode.getTable().stream())
.filter(Objects::nonNull)
- .filter(table -> Objects.nonNull(table.getFlow()))
+ .filter(table -> table.getFlow() != null)
.flatMap(table -> table.getFlow().stream())
.filter(Objects::nonNull)
- .filter(flow -> Objects.nonNull(flow.getId()))
+ .filter(flow -> flow.getId() != null)
.forEach(flowConsumer);
// After we are done with reading from datastore, close the transaction