Skip to content
Snippets Groups Projects
Commit ff6eead5 authored by Mirco Nasuti's avatar Mirco Nasuti
Browse files

list voted apps by user

parent 9c4f8829
No related branches found
No related tags found
No related merge requests found
......@@ -10,12 +10,10 @@ import com.google.gson.annotations.Expose;
import io.swagger.annotations.ApiModel;
import javax.persistence.*;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@Entity
@Table(name = "`user`")
......@@ -339,4 +337,10 @@ public class User {
public void setAppsVotes(Set<Vote> appsVotes) {
this.appsVotes = appsVotes;
}
public Set<App> getVotedApps() {
return appsVotes.stream().map(Vote::getApp).collect(Collectors.toCollection(LinkedHashSet::new));
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment