Skip to content

Commit

Permalink
fix: changed parameter type for rest params when we use generics to f…
Browse files Browse the repository at this point in the history
…ix jersey warning
  • Loading branch information
angelo.andreussi authored and Coduz committed Jun 25, 2024
1 parent b38d7a3 commit d77802f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public <V extends Comparable<V>> MessageListResult simpleQuery(@PathParam("scope
@QueryParam("startDate") DateParam startDateParam,
@QueryParam("endDate") DateParam endDateParam,
@QueryParam("metricName") String metricName,
@QueryParam("metricType") MetricType<V> metricType,
@QueryParam("metricType") String metricType,
@QueryParam("metricMin") String metricMinValue,
@QueryParam("metricMax") String metricMaxValue,
@QueryParam("sortDir") @DefaultValue("DESC") SortDirection sortDir,
Expand All @@ -115,7 +115,9 @@ public <V extends Comparable<V>> MessageListResult simpleQuery(@PathParam("scope
}

if (!Strings.isNullOrEmpty(metricName)) {
andPredicate.getPredicates().add(getMetricPredicate(metricName, metricType, metricMinValue, metricMaxValue));
MetricType<V> internalMetricType = new MetricType<>(metricType);

andPredicate.getPredicates().add(getMetricPredicate(metricName, internalMetricType, metricMinValue, metricMaxValue));
}

MessageQuery query = MESSAGE_STORE_FACTORY.newQuery(scopeId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.eclipse.kapua.app.api.core.resources.AbstractKapuaResource;
import org.eclipse.kapua.app.api.resources.v1.resources.marker.JsonSerializationFixed;
import org.eclipse.kapua.app.api.core.model.DateParam;
import org.eclipse.kapua.app.api.core.model.MetricType;
import org.eclipse.kapua.app.api.core.model.ScopeId;
import org.eclipse.kapua.app.api.core.model.StorableEntityId;
import org.eclipse.kapua.app.api.core.model.data.JsonDatastoreMessage;
Expand Down Expand Up @@ -89,7 +88,7 @@ public <V extends Comparable<V>> JsonMessageListResult simpleQueryJson(@PathPara
@QueryParam("startDate") DateParam startDateParam,
@QueryParam("endDate") DateParam endDateParam,
@QueryParam("metricName") String metricName,
@QueryParam("metricType") MetricType<V> metricType,
@QueryParam("metricType") String metricType,
@QueryParam("metricMin") String metricMinValue,
@QueryParam("metricMax") String metricMaxValue,
@QueryParam("sortDir") @DefaultValue("DESC") SortDirection sortDir,
Expand Down

0 comments on commit d77802f

Please sign in to comment.