Murat Parlakisik | f95672c | 2016-12-05 00:53:17 -0800 | [diff] [blame^] | 1 | |
| 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 | } |