Project

General

Profile

« Previous | Next » 

Revision 9bcc56f3

Added by Andreas Müller over 3 years ago

cleanup

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/cdmLight/CdmLightClassificationExport.java
1855 1855
            csvLine[table.getIndex(CdmLightExportTable.REF_TYPE)] = reference.getType().getKey();
1856 1856

  
1857 1857
            state.getProcessor().put(table, reference, csvLine);
1858

  
1859

  
1860 1858
        } catch (Exception e) {
1861 1859
            state.getResult().addException(e, "An unexpected error occurred when handling reference "
1862 1860
                    + cdmBaseStr(reference) + ": " + e.getMessage());
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/cdmLight/OrderHelper.java
15 15
/**
16 16
 * @author k.luther
17 17
 * @since 21.05.2019
18
 *
19 18
 */
20 19
public class OrderHelper {
21 20

  
22

  
23 21
    int orderIndex;
24 22
    UUID taxonUuid;
25 23
    List<OrderHelper> children;
......
29 27
        this.taxonUuid = uuid;
30 28
    }
31 29

  
32
    /**
33
     * @return the orderIndex
34
     */
35 30
    public int getOrderIndex() {
36 31
        return orderIndex;
37 32
    }
38
    /**
39
     * @param orderIndex the orderIndex to set
40
     */
41 33
    public void setOrderIndex(int orderIndex) {
42 34
        this.orderIndex = orderIndex;
43 35
    }
44
    /**
45
     * @return the uuid
46
     */
36

  
47 37
    public UUID getTaxonUuid() {
48 38
        return taxonUuid;
49 39
    }
50 40

  
51
    /**
52
     * @return the children
53
     */
54 41
    public List<OrderHelper> getChildren() {
55 42
        return children;
56 43
    }
57
    /**
58
     * @param children the children to set
59
     */
60 44
    public void setChildren(List<OrderHelper> children) {
61 45
        this.children = children;
62 46
    }
63 47

  
64
    /**
65
     * @param children the children to set
66
     */
67 48
    public void addChild(OrderHelper child) {
68 49
        if (children == null){
69
            children = new ArrayList();
50
            children = new ArrayList<>();
70 51
        }
71 52
        this.children.add(child);
72 53
    }
73 54

  
74
    /**
75
     * @param children the children to set
76
     */
77 55
    public void addChildren(List<OrderHelper> children) {
78 56
        if (children == null){
79 57
            return;
80 58
        }
81 59
        if (this.children == null){
82
           this.children = new ArrayList();
60
           this.children = new ArrayList<>();
83 61
        }
84 62
        for (OrderHelper child: children){
85 63
            this.children.add(child);
86 64
        }
87 65
    }
88

  
89

  
90

  
91
}
66
}
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dto/TaxonNodeDtoByRankAndNameComparator.java
10 10

  
11 11
import java.io.Serializable;
12 12
import java.util.Comparator;
13
import java.util.UUID;
14 13

  
15 14
import eu.etaxonomy.cdm.model.common.OrderIndexComparator;
16 15
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
......
21 20
/**
22 21
 * @author k.luther
23 22
 * @since 18.03.2010
24
 *
25 23
 */
26 24
public class TaxonNodeDtoByRankAndNameComparator implements Serializable, Comparator<TaxonNodeDto> {
27 25
	private static final long serialVersionUID = 2596641007876609704L;
......
34 32
	    boolean node1Unplaced = node1.isUnplaced();
35 33
	    boolean node2Unplaced = node2.isUnplaced();
36 34

  
37

  
38 35
		if (node1.getUuid().equals(node2.getUuid())){
39 36
			return 0;
40 37
		}
......
60 57
            return 1;
61 58
        }
62 59

  
63

  
64

  
65

  
66 60
		Integer rankTax1 = node1.getRankOrderIndex();
67 61
		Integer rankTax2 = node2.getRankOrderIndex();
68 62

  
......
101 95
		}
102 96
	}
103 97

  
104
    /**
105
     * @param taxon1
106
     * @return
107
     */
108 98
    public String getTaxonTitle(TaxonBase<?> taxon, TaxonNode node) {
109 99
        return (taxon == null) ? node.getUuid().toString(): taxon.getTitleCache();
110 100
    }
111

  
112
    /**
113
     * @param taxon
114
     * @param node
115
     * @return
116
     */
117
    private UUID getTaxonUuid(TaxonBase<?> taxon, TaxonNode node) {
118
        return (taxon == null) ? node.getUuid(): taxon.getUuid();
119
    }
120

  
121

  
122

  
123 101
}

Also available in: Unified diff