Skip to content

Commit

Permalink
accessing the method to avoid generics issue
Browse files Browse the repository at this point in the history
  • Loading branch information
fmendezh committed Mar 21, 2024
1 parent 5450c85 commit 087d914
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
package org.gbif.registry.search.dataset.indexing.ws;

import org.gbif.api.model.checklistbank.search.NameUsageSearchRequest;
import org.gbif.api.model.common.paging.Pageable;
import org.gbif.api.model.common.search.FacetedSearchRequest;
import org.gbif.api.model.common.search.SearchParameter;
Expand All @@ -33,6 +34,8 @@

import lombok.experimental.UtilityClass;

import org.gbif.api.model.occurrence.search.OccurrenceSearchRequest;

import static org.gbif.registry.search.dataset.indexing.ws.WebserviceParameter.DEFAULT_SEARCH_PARAM_VALUE;
import static org.gbif.registry.search.dataset.indexing.ws.WebserviceParameter.PARAM_FACET;
import static org.gbif.registry.search.dataset.indexing.ws.WebserviceParameter.PARAM_FACET_LIMIT;
Expand All @@ -47,7 +50,15 @@
@UtilityClass
public class SearchParameterProvider {

public static <P extends SearchParameter, R extends FacetedSearchRequest<P>>
public static ProxyRetrofitQueryMap getParameterFromFacetedRequest(NameUsageSearchRequest nameUsageSearchRequest) {
return getParameterFromSearchRequest(nameUsageSearchRequest);
}

public static ProxyRetrofitQueryMap getParameterFromFacetedRequest(OccurrenceSearchRequest occurrenceSearchRequest) {
return getParameterFromSearchRequest(occurrenceSearchRequest);
}

private static <P extends SearchParameter, R extends FacetedSearchRequest<P>>
ProxyRetrofitQueryMap getParameterFromFacetedRequest(@Nullable R searchRequest) {
// The searchRequest is transformed in a parameter map
ProxyRetrofitQueryMap parameters = getParameterFromSearchRequest(searchRequest);
Expand Down Expand Up @@ -85,7 +96,7 @@ ProxyRetrofitQueryMap getParameterFromFacetedRequest(@Nullable R searchRequest)
return parameters;
}

public static <P extends SearchParameter> ProxyRetrofitQueryMap getParameterFromSearchRequest(
private static <P extends SearchParameter> ProxyRetrofitQueryMap getParameterFromSearchRequest(
@Nullable SearchRequest<P> searchRequest) {

// The searchRequest is transformed in a parameter map
Expand Down

0 comments on commit 087d914

Please sign in to comment.