Skip to content

Commit

Permalink
#217 refactor sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorsten Marx committed Jul 1, 2024
1 parent 7b6f81a commit 9313e44
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ public enum Type {

Map<String, ContentNode> getTree();

<T> ContentQuery<T> query(final BiFunction<ContentNode, Integer, T> nodeMapper);
<T> ContentQuery<T> query(final String startURI, final BiFunction<ContentNode, Integer, T> nodeMapper);
<Q> ContentQuery<Q> query(final BiFunction<ContentNode, Integer, Q> nodeMapper);
<Q> ContentQuery<Q> query(final String startURI, final BiFunction<ContentNode, Integer, Q> nodeMapper);
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void close() throws IOException {

@Override
public <T> ContentQuery<T> query(final BiFunction<ContentNode, Integer, T> nodeMapper) {
return new MemoryQuery(new ArrayList<>(nodes.values()), nodeMapper);
return new MemoryQuery<T>(new ArrayList<>(nodes.values()), nodeMapper);
}

@Override
Expand All @@ -99,7 +99,7 @@ public <T> ContentQuery<T> query(final String startURI, final BiFunction<Content

var filtered = getNodes().values().stream().filter(node -> node.uri().startsWith(uri)).toList();

return new MemoryQuery(filtered, nodeMapper);
return new MemoryQuery<T>(filtered, nodeMapper);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @author t.marx
* @param <T>
*/
public class MemoryQuery<T extends ContentNode> extends ExtendableQuery<T> {
public class MemoryQuery<T> extends ExtendableQuery<T> {

private QueryContext<T> context;

Expand Down Expand Up @@ -191,7 +191,7 @@ public Map<Object, List<ContentNode>> groupby(final String field) {
return QueryUtil.groupby(context.getNodes(), field);
}

public static record Sort<T extends ContentNode>(String field, QueryContext context) implements ContentQuery.Sort<T> {
public static record Sort<T>(String field, QueryContext context) implements ContentQuery.Sort<T> {

public MemoryQuery<T> asc() {
return new MemoryQuery(sorted(context, field, true));
Expand Down

0 comments on commit 9313e44

Please sign in to comment.