Project

General

Profile

Download (3.05 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

    
10
package eu.etaxonomy.cdm.persistence.dto;
11

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

    
15
import org.apache.log4j.Logger;
16

    
17
import eu.etaxonomy.cdm.model.common.ICdmBase;
18

    
19
/**
20
 * @author n.hoffmann
21
 * @since Aug 14, 2009
22
 * @version 1.0
23
 */
24

    
25

    
26
public class UuidAndTitleCache<T extends ICdmBase> implements Serializable {
27
	/**
28
	 *
29
	 */
30
	private static final long serialVersionUID = 3446993458279371682L;
31

    
32
	@SuppressWarnings("unused")
33
	private static final Logger logger = Logger	.getLogger(UuidAndTitleCache.class);
34

    
35
	private Class<T> type;
36
	private UUID uuid;
37
	private Integer id;
38
	private String titleCache;
39
	private String abbrevTitleCache;
40

    
41

    
42
    private boolean isOrphaned;
43

    
44
    public UuidAndTitleCache(UUID uuid, Integer id, String titleCache, String abbrevTitleCache) {
45
        this.uuid = uuid;
46
        this.setTitleCache(titleCache);
47
        this.id = id;
48
        this.abbrevTitleCache = abbrevTitleCache;
49
    }
50
    public UuidAndTitleCache(UUID uuid, Integer id, String titleCache) {
51
        this.uuid = uuid;
52
        this.setTitleCache(titleCache);
53
        this.id = id;
54
        this.abbrevTitleCache = null;
55
    }
56

    
57
    public UuidAndTitleCache(Class<T> type, UUID uuid, Integer id, String titleCache, String abbrevTitleCache) {
58
        this(uuid, id, titleCache, abbrevTitleCache);
59
        this.type = type;
60
        this.isOrphaned = false;
61
    }
62
    public UuidAndTitleCache(Class<T> type, UUID uuid, Integer id, String titleCache) {
63
        this(uuid, id, titleCache, null);
64
        this.type = type;
65
        this.isOrphaned = false;
66
    }
67

    
68
	public UuidAndTitleCache(Class<T> type, UUID uuid, Integer id, String titleCache, Boolean isOrphaned, String abbrevTitleCache) {
69
		this(type, uuid, id, titleCache, abbrevTitleCache);
70
		this.isOrphaned = isOrphaned;
71
	}
72

    
73
	public UuidAndTitleCache(UUID uuid, String titleCache) {
74
        this( uuid, null, titleCache);
75
	}
76

    
77

    
78
	public String getTitleCache() {
79
		return titleCache;
80
	}
81

    
82

    
83
    public String getAbbrevTitleCache() {
84
        return abbrevTitleCache;
85
    }
86

    
87

    
88
	public UUID getUuid() {
89
		return uuid;
90
	}
91

    
92
	public Integer getId() {
93
	    return id;
94
    }
95

    
96
	public Class<T> getType(){
97
		return type;
98
	}
99

    
100
	public boolean getIsOrphaned() {
101
		return this.isOrphaned;
102
	}
103

    
104
    public void setAbbrevTitleCache(String abbrevTitleCache) {
105
        this.abbrevTitleCache = abbrevTitleCache;
106
    }
107
    public void setTitleCache(String titleCache) {
108
        this.titleCache = titleCache;
109
    }
110

    
111
    public void setType(Class<T> type) {
112
        this.type = type;
113
    }
114

    
115
//************************** toString **********************************/
116

    
117
    @Override
118
    public String toString() {
119
        return "UuidAndTitleCache [type= " + type + ", uuid= " + uuid + ", id=" + id + ", titleCache= " + getTitleCache()
120
                + ", isOrphaned=" + isOrphaned + ", abbrevTitleCache= " + abbrevTitleCache +"]";
121
    }
122

    
123

    
124
}
(8-8/8)