import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowRegistryKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowRegistryKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
private final int priority;
private final BigInteger cookie;
private final Match match;
private final int priority;
private final BigInteger cookie;
private final Match match;
- priority = Preconditions.checkNotNull(flow.getPriority(), "flow priority must not be null");
- match = Preconditions.checkNotNull(flow.getMatch(), "Match value must not be null");
+ priority = MoreObjects.firstNonNull(flow.getPriority(), OFConstants.DEFAULT_FLOW_PRIORITY);
+ match = flow.getMatch()==null ? EMPTY_MATCH : flow.getMatch();
cookie = MoreObjects.firstNonNull(flow.getCookie(), OFConstants.DEFAULT_FLOW_COOKIE).getValue();
}
@Override
public boolean equals(final Object o) {
cookie = MoreObjects.firstNonNull(flow.getCookie(), OFConstants.DEFAULT_FLOW_COOKIE).getValue();
}
@Override
public boolean equals(final Object o) {