Project

General

Profile

Download (3.04 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

    
24

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

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

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

    
40

    
41
    private boolean isOrphaned;
42

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

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

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

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

    
76

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

    
81

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

    
86

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

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

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

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

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

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

    
114
//************************** toString **********************************/
115

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

    
122

    
123
}
(8-8/8)