Project

General

Profile

Revision 785b1fed

ID785b1fedbed2504ad2e0191c9724ff6bd6a08760
Parent 009f44be
Child 653d1473

Added by Patrick Plitzner over 1 year ago

ref #8011 Make AbstractTermDto comparable

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dto/AbstractTermDto.java
22 22
 * @date 05.11.2018
23 23
 *
24 24
 */
25
public class AbstractTermDto implements Serializable {
25
public class AbstractTermDto implements Serializable, Comparable<AbstractTermDto> {
26 26

  
27 27
    private static final long serialVersionUID = -7160319884811828125L;
28 28

  
......
142 142
        return true;
143 143
    }
144 144

  
145
    @Override
146
    public int compareTo(AbstractTermDto o) {
147
        if(o == null){
148
            return 1;
149
        }
150
        if(o.getRepresentation_L10n()!=null){
151
            if(representation_L10n==null){
152
                return -1;
153
            }
154
            else{
155
                return representation_L10n.compareTo(o.getRepresentation_L10n());
156
            }
157
        }
158
        else if(representation_L10n!=null){
159
            return 1;
160
        }
161
        return uuid.compareTo(o.getUuid());
162
    }
163

  
145 164
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)