Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.resource; |
| 2 | |
| 3 | /** |
| 4 | * Representation of a request for bandwidth resource. |
| 5 | */ |
Toshio Koide | fa0dff6 | 2014-10-23 11:46:44 -0700 | [diff] [blame] | 6 | public class BandwidthResourceRequest implements ResourceRequest { |
Toshio Koide | 569ca70 | 2014-10-23 11:37:44 -0700 | [diff] [blame] | 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 Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 28 | /** |
| 29 | * Returns the bandwidth resource. |
| 30 | * |
| 31 | * @return the bandwidth resource |
| 32 | */ |
Toshio Koide | d1865a4 | 2014-10-23 12:44:55 -0700 | [diff] [blame^] | 33 | public Bandwidth bandwidth() { |
Toshio Koide | 569ca70 | 2014-10-23 11:37:44 -0700 | [diff] [blame] | 34 | return bandwidth; |
| 35 | } |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 36 | } |