blob: 45a2bdab77702085cf8e49e01a0836a3c30f67ab [file] [log] [blame]
Simon Huntf844f632015-05-20 19:06:35 -07001/*
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 */
17
18package org.onosproject.cord.gui.model;
19
20import com.google.common.collect.ImmutableSet;
21
22import java.util.Set;
23
24
25/**
26 * Base implementation of BundleDescriptor.
27 */
28public class DefaultBundleDescriptor implements BundleDescriptor {
29
30 private final String id;
31 private final String displayName;
32 private final Set<XosFunctionDescriptor> functions;
33
34 /**
35 * Constructs a bundle descriptor.
36 *
37 * @param id bundle identifier
38 * @param displayName bundle display name
39 * @param functions functions that make up this bundle
40 */
41 DefaultBundleDescriptor(String id, String displayName,
42 XosFunctionDescriptor... functions) {
43 this.id = id;
44 this.displayName = displayName;
45 this.functions = ImmutableSet.copyOf(functions);
46 }
47
48
49 public String id() {
50 return id;
51 }
52
53 public String displayName() {
54 return displayName;
55 }
56
57 public Set<XosFunctionDescriptor> functions() {
58 return functions;
59 }
60}