blob: b2856417e656b5201acbd785dfdf235550ad2ff1 [file] [log] [blame]
Sho SHIMIZUf95b96e2016-01-25 19:35:15 -08001/*
2 * Copyright 2016 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 */
16package org.onosproject.net.newresource;
17
18import com.google.common.annotations.Beta;
19
20/**
21 * Factory class for discrete-type resource related instances.
22 */
23@Beta
24public final class DiscreteFactory {
25 private final DiscreteResourceId id;
26
27 /**
28 * Create an instance with the specified resource ID.
29 *
30 * @param id resource ID that is associated with the resource related instances
31 * which will be created from this instance
32 */
33 DiscreteFactory(DiscreteResourceId id) {
34 this.id = id;
35 }
36
37 /**
38 * Returns the resource ID for discrete-type.
39 *
40 * @return discrete-type resource ID
41 */
42 public DiscreteResourceId id() {
43 return id;
44 }
45
46 /**
47 * Returns the resource for discrete-type.
48 *
49 * @return discrete-type resource
50 */
51 public DiscreteResource resource() {
52 return new DiscreteResource(id);
53 }
54}