blob: 194c45888c458fc34b7a7ca5d59c49496a76257e [file] [log] [blame]
public List<OFBucket> insertBucketBasedOnCommandBucketId(OFBucket bucket) {
if(commandBucketId == null)
throw new IllegalStateException("CommandBucketId is null");
if(commandBucketId.equals(OFGroupBucket.BUCKET_FIRST))
buckets.add(0, bucket);
else if(commandBucketId.equals(OFGroupBucket.BUCKET_LAST))
buckets.add(buckets.size(), bucket);
return buckets;
}
public List<OFBucket> insertBucketBasedOnSpecificIndex(OFBucket bucket, int index) {
if(index <= buckets.size())
buckets.add(index,bucket);
else
throw new IllegalStateException("Index is not valid");
return buckets;
}