Changeset ad4243e in Git for src/main/java/com/wediscussmovies/project/querymodels/GenreLikes.java
- Timestamp:
- 02/07/22 21:26:03 (3 years ago)
- Branches:
- main
- Children:
- 0226942
- Parents:
- 7f36551 (diff), 3c0f9a9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Mato-77 <56981531+Mato-77@…> (02/07/22 21:26:03)
- git-committer:
- GitHub <noreply@…> (02/07/22 21:26:03)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/wediscussmovies/project/querymodels/GenreLikes.java
r7f36551 rad4243e 3 3 import lombok.Data; 4 4 5 import javax.persistence.Entity; 6 import javax.persistence.Table; 7 import java.util.Comparator; 8 import java.util.Objects; 9 5 10 @Data 6 11 public class GenreLikes { 7 12 private Integer genreId; 8 13 private String name; 9 14 private Long likes; 10 15 11 public GenreLikes(String name, Long likes) { 16 public static Comparator<GenreLikes> sorter = Comparator.comparing(GenreLikes::getLikes).thenComparing(GenreLikes::getName).reversed(); 17 18 public GenreLikes(Integer genreId, String name, Long likes) { 19 this.genreId = genreId; 12 20 this.name = name; 13 21 this.likes = likes; 22 23 } 24 25 @Override 26 public boolean equals(Object o) { 27 if (this == o) return true; 28 if (o == null || getClass() != o.getClass()) return false; 29 GenreLikes that = (GenreLikes) o; 30 return Objects.equals(genreId, that.genreId); 31 } 32 33 @Override 34 public int hashCode() { 35 return Objects.hash(genreId); 14 36 } 15 37 }
Note:
See TracChangeset
for help on using the changeset viewer.