Skip to content

Method: getId()

1: package de.fhdw.wtf.persistence.meta;
2:
3: public class Role {
4:         
5:         private final long id;
6:         
7:         private final String name;
8:         
9:         public Role(final long id, final String name) {
10:                 super();
11:                 this.id = id;
12:                 this.name = name;
13:         }
14:         
15:         public long getId() {
16:                 return this.id;
17:         }
18:         
19:         public String getName() {
20:                 return this.name;
21:         }
22:         
23:         @Override
24:         public boolean equals(final java.lang.Object obj) {
25:                 if (obj instanceof Role) {
26:                         final Role other = (Role) obj;
27:                         return other.id == this.id && this.name.equals(other.name);
28:                 }
29:                 return false;
30:         }
31:         
32:         @Override
33:         public int hashCode() {
34:                 return (int) this.id + this.name.hashCode();
35:         }
36: }