Project

General

Profile

1
package eu.dnetlib.domain;
2

    
3
import java.util.HashMap;
4
import java.util.Map;
5

    
6
public class EPR {
7
	/** The w3c epr. Kept to avoid parsing/creating it if not needed. */
8
	private String epr = null;
9
	
10
	/** The reference parameters of the w3c epr */
11
	private Map<String, String> parameters = new HashMap<String, String>();
12
	
13
	/** The address of the w3c epr */
14
	private String address = null;
15
	
16
	/** Service name of the w3c epr */
17
	private String serviceName = null;
18
	
19
	/** Endpoint name of the w3c epr */
20
	private String endpointName = null;
21
	
22
	public String getParameter(String name) {
23
		return parameters.get(name);
24
	}
25
	
26
	public void setParameter(String name, String value) {
27
		this.epr = null;
28
		this.parameters.put(name, value);
29
	}
30
	
31
	public String[] getParameterNames() {
32
		return parameters.keySet().toArray(new String[] {});
33
	}
34
	
35
	public void removeParameter(String name) {
36
		this.epr = null;
37
		
38
		this.parameters.remove(name);
39
	}
40
	
41
	public void clearParameters() {
42
		this.epr = null;
43
		
44
		this.parameters.clear();
45
	}
46

    
47
	public String getEpr() {
48
		return epr;
49
	}
50

    
51
	public void setEpr(String epr) {
52
		this.epr = epr;
53
	}
54

    
55
	public String getAddress() {
56
		return address;
57
	}
58

    
59
	public void setAddress(String address) {
60
		this.epr = null;
61
		
62
		this.address = address;
63
	}
64
	
65
	public String getServiceName() {
66
		return serviceName;
67
	}
68

    
69
	public void setServiceName(String serviceName) {
70
		this.serviceName = serviceName;
71
	}
72

    
73
	public String getEndpointName() {
74
		return endpointName;
75
	}
76

    
77
	public void setEndpointName(String endpointName) {
78
		this.endpointName = endpointName;
79
	}
80

    
81
	@Override
82
	public String toString() {
83
		StringBuilder builder = new StringBuilder();
84
		
85
		builder.append("[address: ").append(address).append(", serviceName: ");
86
		builder.append(serviceName).append(", endpointName: ");
87
		builder.append(endpointName).append(", parameters: ");
88
		builder.append(parameters.toString()).append("]");
89
		
90
		return builder.toString();
91
	}
92
}
(5-5/10)