Skip to content

Commit

Permalink
feat: include filters to special parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <[email protected]>
  • Loading branch information
otaviojava committed Aug 29, 2024
1 parent 081b778 commit db1e0df
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,12 @@ static SpecialParameters of(Object[] parameters, Function<String, String> sortPa
Arrays.stream(sortArray).map(s -> mapper(s, sortParser)).forEach(sorts::add);
} else if (parameter instanceof PageRequest request) {
pageRequest = request;
} else if (parameter instanceof Iterable<?> iterable) {
for (Object value : iterable) {
if (value instanceof Sort<?> sortValue) {
sorts.add(mapper(sortValue, sortParser));
}else {
if (parameter instanceof Iterable<?> iterable) {
for (Object value : iterable) {
if (value instanceof Sort<?> sortValue) {
sorts.add(mapper(sortValue, sortParser));
}
}
}
}
Expand All @@ -162,7 +164,8 @@ public static boolean isSpecialParameter(Object parameter) {
return parameter instanceof Sort<?>
|| parameter instanceof Limit
|| parameter instanceof Order<?>
|| parameter instanceof PageRequest;
|| parameter instanceof PageRequest
|| parameter instanceof Sort<?>[];
}

/**
Expand All @@ -185,7 +188,8 @@ public static boolean isSpecialParameter(Class<?> parameter) {
return Sort.class.isAssignableFrom(parameter)
|| Limit.class.isAssignableFrom(parameter)
|| Order.class.isAssignableFrom(parameter)
|| PageRequest.class.isAssignableFrom(parameter);
|| PageRequest.class.isAssignableFrom(parameter)
|| parameter.isArray() && Sort.class.isAssignableFrom(parameter.getComponentType());
}

/**
Expand Down

0 comments on commit db1e0df

Please sign in to comment.