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 @Override
public String toString() { public String toString() {
return name(); return name().toLowerCase();
} }
public static VolumeType fromValue(String resourceType) { public static VolumeType fromValue(String resourceType) {

View File

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