-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathNVPair.java
More file actions
78 lines (65 loc) · 1.36 KB
/
NVPair.java
File metadata and controls
78 lines (65 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package HTTPClient;
/**
* This class holds a Name/Value pair of strings. It's used for headers,
* form-data, attribute-lists, etc. This class is immutable.
*
* @version 0.3-3 06/05/2001
* @author Ronald Tschal�r
*/
public final class NVPair
{
/** the name */
private String name;
/** the value */
private String value;
// Constructors
/**
* Creates a new name/value pair and initializes it to the
* specified name and value.
*
* @param name the name
* @param value the value
*/
public NVPair(String name, String value)
{
this.name = name;
this.value = value;
}
/**
* Creates a copy of a given name/value pair.
*
* @param p the name/value pair to copy
*/
public NVPair(NVPair p)
{
this(p.name, p.value);
}
// Methods
/**
* Get the name.
*
* @return the name
*/
public final String getName()
{
return name;
}
/**
* Get the value.
*
* @return the value
*/
public final String getValue()
{
return value;
}
/**
* Produces a string containing the name and value of this instance.
*
* @return a string containing the class name and the name and value
*/
public String toString()
{
return getClass().getName() + "[name=" + name + ",value=" + value + "]";
}
}