blob: c958271a4ea7927024862d51cb2dc75563b72b5d [file] [log] [blame]
Toshio Koide485b4782014-10-20 19:34:21 -07001package org.onlab.onos.net.resource;
2
3/**
4 * Representation of a request for bandwidth resource.
5 */
Toshio Koide569ca702014-10-23 11:37:44 -07006public final class BandwidthResourceRequest implements ResourceRequest {
7 private final Bandwidth bandwidth;
8
9 /**
10 * Creates a new {@link BandwidthResourceRequest} with {@link Bandwidth}
11 * object.
12 *
13 * @param bandwidth {@link Bandwidth} object to be requested
14 */
15 public BandwidthResourceRequest(Bandwidth bandwidth) {
16 this.bandwidth = bandwidth;
17 }
18
19 /**
20 * Creates a new {@link BandwidthResourceRequest} with bandwidth value.
21 *
22 * @param bandwidth bandwidth value to be requested
23 */
24 public BandwidthResourceRequest(double bandwidth) {
25 this.bandwidth = Bandwidth.valueOf(bandwidth);
26 }
27
Toshio Koide485b4782014-10-20 19:34:21 -070028 /**
29 * Returns the bandwidth resource.
30 *
31 * @return the bandwidth resource
32 */
Toshio Koide569ca702014-10-23 11:37:44 -070033 Bandwidth bandwidth() {
34 return bandwidth;
35 }
Toshio Koide485b4782014-10-20 19:34:21 -070036}