Jian Li
Committed by Charles Chan

Not allow to assign values to appId and cookie at the same time

With current implementation, flow id can be either assigned by
fromApp method or withCookie method. This misleads the end-user
to properly instantiate a new flow rule. This commit restricts the
flow id assignment which does not allow to assign cookie and
appId at the same time.

Change-Id: I8d7e27517c7ef636d427c3d8b8f9cc267fcb0702
......@@ -364,7 +364,7 @@ public class DefaultFlowRule implements FlowRule {
@Override
public FlowRule build() {
checkArgument(flowId != null || appId != null, "Either an application" +
checkArgument((flowId != null) ^ (appId != null), "Either an application" +
" id or a cookie must be supplied");
checkNotNull(selector, "Traffic selector cannot be null");
checkArgument(timeout != null || permanent != null, "Must either have " +
......