Use the VolumeType enum in ListVolumesOptions

This commit is contained in:
andreisavu 2011-12-11 13:27:30 +02:00
parent ed9e4c8232
commit 78e36e7904
2 changed files with 5 additions and 4 deletions

View File

@ -649,7 +649,7 @@ public class Volume implements Comparable<Volume> {
@Override
public String toString() {
return name();
return name().toLowerCase();
}
public static VolumeType fromValue(String resourceType) {

View File

@ -19,6 +19,7 @@
package org.jclouds.cloudstack.options;
import com.google.common.collect.ImmutableSet;
import org.jclouds.cloudstack.domain.Volume;
/**
* Options used to control what volume
@ -84,8 +85,8 @@ public class ListVolumesOptions extends AccountInDomainOptions {
/**
* @param type the type of the disk volume
*/
public ListVolumesOptions type(String type) {
this.queryParameters.replaceValues("type", ImmutableSet.of(type + ""));
public ListVolumesOptions type(Volume.VolumeType type) {
this.queryParameters.replaceValues("type", ImmutableSet.of(type .toString()));
return this;
}
@ -178,7 +179,7 @@ public class ListVolumesOptions extends AccountInDomainOptions {
/**
* @see ListVolumesOptions#type
*/
public static ListVolumesOptions type(String type) {
public static ListVolumesOptions type(Volume.VolumeType type) {
ListVolumesOptions options = new ListVolumesOptions();
return options.type(type);
}