Project

General

Profile

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

    
72
	/**
73
	 * @return the titleCache
74
	 */
75
	public String getTitleCache() {
76
		return titleCache;
77
	}
78

    
79

    
80
    /**
81
     * @return the titleCache
82
     */
83
    public String getAbbrevTitleCache() {
84
        return abbrevTitleCache;
85
    }
86

    
87

    
88
	/**
89
	 * @return the uuid
90
	 */
91
	public UUID getUuid() {
92
		return uuid;
93
	}
94

    
95
	public Integer getId() {
96
	    return id;
97
    }
98

    
99
	public Class<T> getType(){
100
		return type;
101
	}
102

    
103
	public boolean getIsOrphaned() {
104
		return this.isOrphaned;
105
	}
106

    
107
//************************** toString **********************************/
108

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

    
115

    
116
}
(7-7/7)