35 long id1 = 0L, id2 = 0L;
36 String n1 =
null, n2 =
null, d1 =
null, d2 =
null;
38 if(o1 instanceof CategoryParticipant) {
39 id1 = zeroIfNull(((CategoryParticipant) o1).getId());
40 }
else if(o1 instanceof Participant) {
41 id1 = zeroIfNull(((Participant) o1).getId());
42 }
else if(o1 instanceof IssueParticipant) {
43 id1 = zeroIfNull(((IssueParticipant) o1).getId());
45 if(o1 instanceof IDossierParticipant) {
46 n1 = ((IDossierParticipant) o1).getName();
47 d1 = ((IDossierParticipant) o1).getDiscriminator();
48 r1 = convertToInt((IDossierParticipant) o1);
49 }
else if(o1 instanceof IssueParticipant) {
50 n1 = ((IssueParticipant) o1).getName();
51 r1 = convertToInt((IssueParticipant) o1);
53 if(o2 instanceof CategoryParticipant) {
54 id2 = zeroIfNull(((CategoryParticipant) o2).getId());
55 }
else if(o2 instanceof Participant) {
56 id2 = zeroIfNull(((Participant) o2).getId());
57 }
else if(o2 instanceof IssueParticipant) {
58 id2 = zeroIfNull(((IssueParticipant) o2).getId());
60 if(o2 instanceof IDossierParticipant) {
61 n2 = ((IDossierParticipant) o2).getName();
62 d2 = ((IDossierParticipant) o2).getDiscriminator();
63 r2 = convertToInt((IDossierParticipant) o2);
64 }
else if(o2 instanceof IssueParticipant) {
65 n2 = ((IssueParticipant) o2).getName();
66 r2 = convertToInt((IssueParticipant) o2);
68 int result = CompareUtil.compare(r1, r2);
69 if(result == 0) result = CompareUtil.compare(n1, n2);
70 if(result == 0) result = CompareUtil.compare(d1, d2);
71 if(result == 0) result = CompareUtil.compare(id1, id2);