blob: 194c45888c458fc34b7a7ca5d59c49496a76257e [file] [log] [blame]
Murat Parlakisikf95672c2016-12-05 00:53:17 -08001
2 public List<OFBucket> insertBucketBasedOnCommandBucketId(OFBucket bucket) {
3 if(commandBucketId == null)
4 throw new IllegalStateException("CommandBucketId is null");
5 if(commandBucketId.equals(OFGroupBucket.BUCKET_FIRST))
6 buckets.add(0, bucket);
7 else if(commandBucketId.equals(OFGroupBucket.BUCKET_LAST))
8 buckets.add(buckets.size(), bucket);
9 return buckets;
10 }
11
12
13 public List<OFBucket> insertBucketBasedOnSpecificIndex(OFBucket bucket, int index) {
14 if(index <= buckets.size())
15 buckets.add(index,bucket);
16 else
17 throw new IllegalStateException("Index is not valid");
18 return buckets;
19 }