01: package org.osbl.orga.model;
02:
03: import org.osbl.identity.model.Identity;
04: import org.conform.*;
05:
06: @Bean(format=FormatType.CUSTOM,formatClass="org.osbl.orga.model.MembershipFormat")
07: public class Membership implements Comparable {
08: Long id;
09: @Property(mandatory="true")
10: Member member;
11: @Property(mandatory="true")
12: Group group;
13: @Property(mandatory="true")
14: String role;
15:
16: public Membership() {
17: }
18:
19: public Membership(Member member, Group group, String role) {
20: this .member = member;
21: this .group = group;
22: this .role = role;
23: }
24:
25: public Long getId() {
26: return id;
27: }
28:
29: public void setId(Long id) {
30: this .id = id;
31: }
32:
33: public Member getMember() {
34: return member;
35: }
36:
37: public void setMember(Member member) {
38: this .member = member;
39: }
40:
41: public Group getGroup() {
42: return group;
43: }
44:
45: public void setGroup(Group group) {
46: this .group = group;
47: }
48:
49: public String getRole() {
50: return role;
51: }
52:
53: public void setRole(String role) {
54: this .role = role;
55: }
56:
57: public int compareTo(Object o) {
58: Membership m = (Membership) o;
59: if (id == null && m.id != null)
60: return 1;
61: else if (id != null && m.id == null)
62: return -1;
63: else if (id == null && m.id == null)
64: return 0;
65: else
66: return id.compareTo(m.id);
67: }
68: }
|