Implement BandwidthResourceRequest class and its builder.
diff --git a/core/api/src/main/java/org/onlab/onos/net/resource/BandwidthResourceRequest.java b/core/api/src/main/java/org/onlab/onos/net/resource/BandwidthResourceRequest.java
index 2ea24b8..c958271 100644
--- a/core/api/src/main/java/org/onlab/onos/net/resource/BandwidthResourceRequest.java
+++ b/core/api/src/main/java/org/onlab/onos/net/resource/BandwidthResourceRequest.java
@@ -3,11 +3,34 @@
/**
* Representation of a request for bandwidth resource.
*/
-public interface BandwidthResourceRequest {
+public final class BandwidthResourceRequest implements ResourceRequest {
+ private final Bandwidth bandwidth;
+
+ /**
+ * Creates a new {@link BandwidthResourceRequest} with {@link Bandwidth}
+ * object.
+ *
+ * @param bandwidth {@link Bandwidth} object to be requested
+ */
+ public BandwidthResourceRequest(Bandwidth bandwidth) {
+ this.bandwidth = bandwidth;
+ }
+
+ /**
+ * Creates a new {@link BandwidthResourceRequest} with bandwidth value.
+ *
+ * @param bandwidth bandwidth value to be requested
+ */
+ public BandwidthResourceRequest(double bandwidth) {
+ this.bandwidth = Bandwidth.valueOf(bandwidth);
+ }
+
/**
* Returns the bandwidth resource.
*
* @return the bandwidth resource
*/
- Bandwidth bandwidth();
+ Bandwidth bandwidth() {
+ return bandwidth;
+ }
}