Project

General

Profile

Download (3.4 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
 */
23
public class UuidAndTitleCache<T extends ICdmBase> implements Serializable {
24

    
25
	private static final long serialVersionUID = 3446993458279371682L;
26

    
27
	@SuppressWarnings("unused")
28
	private static final Logger logger = Logger	.getLogger(UuidAndTitleCache.class);
29

    
30
	private Class<? extends T> type;
31
	final private UUID uuid;
32
	private Integer id;
33
	private String titleCache;
34
	private String abbrevTitleCache;
35
	private boolean isProtectedTitleCache = true;
36

    
37
    private boolean isOrphaned;
38

    
39
    public UuidAndTitleCache(UUID uuid, Integer id, String titleCache, String abbrevTitleCache) {
40
        this.uuid = uuid;
41
        this.setTitleCache(titleCache);
42
        this.id = id;
43
        this.abbrevTitleCache = abbrevTitleCache;
44
    }
45

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

    
53
    public UuidAndTitleCache(Class<? extends T> type, UUID uuid, Integer id, String titleCache, String abbrevTitleCache) {
54
        this(uuid, id, titleCache, abbrevTitleCache);
55
        this.type = type;
56
        this.isOrphaned = false;
57
    }
58

    
59
    public UuidAndTitleCache(Class<? extends T> type, UUID uuid, Integer id, String titleCache) {
60
        this(uuid, id, titleCache, null);
61
        this.type = type;
62
        this.isOrphaned = false;
63
    }
64

    
65
	public UuidAndTitleCache(Class<? extends T> type, UUID uuid, Integer id, String titleCache, Boolean isOrphaned, String abbrevTitleCache) {
66
		this(type, uuid, id, titleCache, abbrevTitleCache);
67
		this.isOrphaned = isOrphaned;
68
	}
69

    
70
	public UuidAndTitleCache(UUID uuid, String titleCache) {
71
        this( uuid, null, titleCache);
72
	}
73

    
74
//  ******************* GETTER / SETTER **********************/
75

    
76
	public String getTitleCache() {
77
		return titleCache;
78
	}
79
	public void setTitleCache(String titleCache) {
80
        this.titleCache = titleCache;
81
    }
82

    
83
    public String getAbbrevTitleCache() {
84
        return abbrevTitleCache;
85
    }
86
    public void setAbbrevTitleCache(String abbrevTitleCache) {
87
        this.abbrevTitleCache = abbrevTitleCache;
88
    }
89

    
90
    public boolean isProtectedTitleCache() {
91
        return isProtectedTitleCache;
92
    }
93
    public void setProtectedTitleCache(boolean isProtectedTitleCache) {
94
        this.isProtectedTitleCache = isProtectedTitleCache;
95
    }
96

    
97
	public UUID getUuid() {
98
		return uuid;
99
	}
100

    
101
	public Integer getId() {
102
	    return id;
103
    }
104

    
105
	public Class<? extends T> getType(){
106
		return type;
107
	}
108

    
109
	public boolean getIsOrphaned() {
110
		return this.isOrphaned;
111
	}
112

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

    
117
//************************** toString **********************************/
118

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