summaryrefslogtreecommitdiffstats
path: root/ceilometer-client/src/main/java/com/woorea
diff options
context:
space:
mode:
authorIsaac Manuel Raj <isaac.manuelraj@huawei.com>2019-04-12 11:39:53 +0530
committerIsaac Manuel Raj <isaac.manuelraj@huawei.com>2019-04-12 11:46:08 +0530
commitc712db17091c639f1b8515edcced0cbb52c81a17 (patch)
tree7a5dfd6ef3546faeef4e545da314f748a15821c1 /ceilometer-client/src/main/java/com/woorea
parent05c2d103b96f463f1da9e12ea9301dce67b75dce (diff)
Code Enhancement (Sonar Fixes)
Sonar Issues Fixes Issue-ID: SO-1490 Change-Id: Id171ab3833265715cd8976ad9f166a2e10c6561d Signed-off-by: Isaac Manuel Raj <isaac.manuelraj@huawei.com>
Diffstat (limited to 'ceilometer-client/src/main/java/com/woorea')
-rw-r--r--ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/QueriableCeilometerCommand.java32
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