BrightSide Workbench Full Report + Source Code
org.turro.dossier.dossier.ParticipantComparator Class Reference
Inheritance diagram for org.turro.dossier.dossier.ParticipantComparator:
Collaboration diagram for org.turro.dossier.dossier.ParticipantComparator:

Public Member Functions

int compare (Object o1, Object o2)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 31 of file ParticipantComparator.java.

Member Function Documentation

◆ compare()

int org.turro.dossier.dossier.ParticipantComparator.compare ( Object  o1,
Object  o2 
)

Definition at line 34 of file ParticipantComparator.java.

34  {
35  long id1 = 0L, id2 = 0L;
36  String n1 = null, n2 = null, d1 = null, d2 = null;
37  int r1 = 0, r2 = 0;
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());
44  }
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);
52  }
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());
59  }
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);
67  }
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);
72  return result;
73  }

The documentation for this class was generated from the following file: