blob: 07ecadcbc3c1d1abfab1ed3b6b42ef0b84d224bd [file] [log] [blame]
Murat Parlakisikf95672c2016-12-05 00:53:17 -08001
2 public List<OFBucket> removeBucketBasedOnCommandBucketId() {
3 if(commandBucketId == null)
4 throw new IllegalStateException("CommandBucketId is null");
5 if(commandBucketId.equals(OFGroupBucket.BUCKET_FIRST))
6 buckets.remove(0);
7 else if(commandBucketId.equals(OFGroupBucket.BUCKET_LAST))
8 buckets.remove(buckets.size()-1);
9 else if(commandBucketId.equals(OFGroupBucket.BUCKET_ALL))
10 buckets.removeAll(buckets);
11 return buckets;
12 }
13
14
15 public List<OFBucket> removeBucketBasedOnSpecificIndex(int index) {
16 if(index <= buckets.size())
17 buckets.remove(index);
18 else
19 throw new IllegalStateException("Index is not valid");
20 return buckets;
21 }