Project

General

Profile

Download (867 Bytes) Statistics
| Branch: | Tag: | Revision:
1
package eu.etaxonomy.cdm.remote.editor;
2

    
3
import java.util.ArrayList;
4
import java.util.HashSet;
5
import java.util.Set;
6
import java.util.UUID;
7

    
8

    
9
/**
10
 * @author f.revilla
11
 * @since 09.06.2010
12
 */
13
public class UuidList extends ArrayList<UUID> {
14

    
15
    private static final long serialVersionUID = -7844234502924643928L;
16

    
17
    public Set<UUID> asSet() {
18
        HashSet<UUID> tmpSet = new HashSet<>(this.size());
19
        tmpSet.addAll(this);
20
        return tmpSet;
21
    }
22

    
23
    @Override
24
    public String toString() {
25
        String result = "";
26
        for (UUID uuid : this){
27
            if(uuid != null){
28
                result +=  (result.isEmpty() ? "": ",") + uuid.toString();
29
            } else {
30
                result += (result.isEmpty() ? "": ",") + "NULL";
31
            }
32
        }
33
        return "[" + result + "]";
34
    }
35

    
36

    
37

    
38
}
(19-19/19)