Project

General

Profile

1
package eu.dnetlib.msro.workflows.dli.model;
2

    
3
import org.apache.commons.lang.StringEscapeUtils;
4

    
5
/**
6
 * The Class PID.
7
 */
8
public class DLIPID {
9

    
10
	/** The id. */
11
	private String id;
12

    
13
	/** The type. */
14
	private String type;
15

    
16
	/**
17
	 * Instantiates a new pid.
18
	 */
19
	public DLIPID() {
20

    
21
	}
22

    
23
	/**
24
	 * Instantiates a new pid.
25
	 *
26
	 * @param id
27
	 *            the id
28
	 * @param type
29
	 *            the type
30
	 */
31
	public DLIPID(final String id, final String type) {
32
		if (id != null) {
33
			this.id = id.replace("http://dx.doi.org/", "");
34
		}
35
		this.type = type;
36
	}
37

    
38
	/**
39
	 * Gets the id.
40
	 *
41
	 * @return the id
42
	 */
43
	public String getId() {
44
		return id;
45
	}
46

    
47
	public String getEscapeXMLId() {
48
		return StringEscapeUtils.escapeXml(id);
49
	}
50

    
51
	/**
52
	 * Sets the id.
53
	 *
54
	 * @param id
55
	 *            the id to set
56
	 */
57
	public void setId(final String id) {
58
		if (id != null) {
59
			this.id = id.replace("http://dx.doi.org/", "");
60
		};
61
	}
62

    
63
	/**
64
	 * Gets the type.
65
	 *
66
	 * @return the type
67
	 */
68
	public String getType() {
69
		return type;
70
	}
71

    
72
	/**
73
	 * Sets the type.
74
	 *
75
	 * @param type
76
	 *            the type to set
77
	 */
78
	public void setType(final String type) {
79
		if (type != null) {
80
			this.type = type.toUpperCase();
81
		} else {
82
			this.type = type;
83
		}
84
	}
85
}
(4-4/8)