diff options
-rw-r--r-- | ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/QueriableCeilometerCommand.java | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/QueriableCeilometerCommand.java b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/QueriableCeilometerCommand.java index 83eecd4..d8c0ead 100644 --- a/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/QueriableCeilometerCommand.java +++ b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/QueriableCeilometerCommand.java @@ -23,52 +23,42 @@ import java.util.List; import com.woorea.openstack.base.client.OpenStackRequest; public abstract class QueriableCeilometerCommand<T,R> extends OpenStackRequest<R> { - + protected List<String> fields = new ArrayList<>(); - + protected List<String> ops = new ArrayList<>(); - + protected List<Serializable> values = new ArrayList<>(); - + private T filter(String field, String op, Serializable value) { fields.add(field); ops.add(op); values.add(value); return (T) this; } - + public T lt(String field, Serializable value) { return filter(field, "lt", value); } - + public T le(String field, Serializable value) { return filter(field, "le", value); } - + public T eq(String field, Serializable value) { return filter(field, "eq", value); } - + public T ne(String field, Serializable value) { return filter(field, "ne", value); } - + public T ge(String field, Serializable value) { return filter(field, "ge", value); } - + public T gt(String field, Serializable value) { return filter(field, "gt", value); } - /* - public WebTarget query(WebTarget target) { - if(fields.size() > 0) { - target = target.queryParam("q.field", fields.toArray()); - target = target.queryParam("q.op", ops.toArray()); - target = target.queryParam("q.value", values.toArray()); - } - return target; - } - */ -} +}
\ No newline at end of file |