Advertisement
bisaggio

Untitled

Aug 12th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. @Entity
  2. @Table(name = "authority")
  3. public class Authority extends DefaultTimeStamped implements Serializable {
  4.  
  5. private static final long serialVersionUID = 1L;
  6.  
  7. @NotNull
  8. @Size(min = 0, max = 50)
  9. @Id
  10. @Column(length = 50)
  11. private String name;
  12.  
  13. public String getName() {
  14. return name;
  15. }
  16.  
  17. public void setName(String name) {
  18. this.name = name;
  19. }
  20.  
  21. @Override
  22. public boolean equals(Object o) {
  23. if (this == o) {
  24. return true;
  25. }
  26. if (o == null || getClass() != o.getClass()) {
  27. return false;
  28. }
  29.  
  30. Authority authority = (Authority) o;
  31.  
  32. if (name != null ? !name.equals(authority.name) : authority.name != null) {
  33. return false;
  34. }
  35.  
  36. return true;
  37. }
  38.  
  39. @Override
  40. public int hashCode() {
  41. return name != null ? name.hashCode() : 0;
  42. }
  43.  
  44. @Override
  45. public String toString() {
  46. return "Authority{"
  47. + "name='" + name + '\''
  48. + "}";
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement