Project

General

Profile

Download (2.87 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
 * @created 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
	private boolean isOrphaned;
41

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

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

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

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

    
75
	/**
76
	 * @return the titleCache
77
	 */
78
	public String getTitleCache() {
79
		return titleCache;
80
	}
81

    
82

    
83
    /**
84
     * @return the titleCache
85
     */
86
    public String getAbbrevTitleCache() {
87
        return abbrevTitleCache;
88
    }
89

    
90

    
91
	/**
92
	 * @return the uuid
93
	 */
94
	public UUID getUuid() {
95
		return uuid;
96
	}
97

    
98
	public Integer getId() {
99
	    return id;
100
    }
101

    
102
	public Class<T> getType(){
103
		return type;
104
	}
105

    
106
	public boolean getIsOrphaned() {
107
		return this.isOrphaned;
108
	}
109

    
110
//************************** toString **********************************/
111

    
112
    @Override
113
    public String toString() {
114
        return "UuidAndTitleCache [type= " + type + ", uuid= " + uuid + ", id=" + id + ", titleCache= " + titleCache
115
                + ", isOrphaned=" + isOrphaned + ", abbrevTitleCache= " + abbrevTitleCache +"]";
116
    }
117

    
118

    
119
}
(7-7/7)