Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.onosproject.net.group; |
| 17 | |
| 18 | import static com.google.common.base.Preconditions.checkNotNull; |
| 19 | |
| 20 | import java.util.List; |
| 21 | |
| 22 | |
| 23 | import com.google.common.collect.ImmutableList; |
| 24 | |
| 25 | public final class GroupBuckets { |
| 26 | private final List<GroupBucket> buckets; |
| 27 | |
| 28 | /** |
| 29 | * Creates a immutable list of group bucket. |
| 30 | * |
| 31 | * @param buckets list of group bucket |
| 32 | */ |
| 33 | public GroupBuckets(List<GroupBucket> buckets) { |
| 34 | this.buckets = ImmutableList.copyOf(checkNotNull(buckets)); |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Immutable list of group buckets. |
| 39 | * |
| 40 | * @return list of group bucket |
| 41 | */ |
| 42 | public List<GroupBucket> buckets() { |
| 43 | return buckets; |
| 44 | } |
| 45 | |
| 46 | } |