1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springbyexample.httpclient.auth;
18
19 import java.io.Serializable;
20
21
22
23
24
25
26
27
28
29
30
31 public class Credentials implements Serializable {
32
33 private static final long serialVersionUID = 427351901207639483L;
34
35 protected String authScopeHost = null;
36 protected int authScopePort = 80;
37 protected String userName = null;
38 protected String password = null;
39
40
41
42
43 public Credentials() {}
44
45
46
47
48 public Credentials(String authScopeHost, int authScopePort,
49 String userName, String password) {
50 this.authScopeHost = authScopeHost;
51 this.authScopePort = authScopePort;
52 this.userName = userName;
53 this.password = password;
54 }
55
56
57
58
59 public String getAuthScopeHost() {
60 return authScopeHost;
61 }
62
63
64
65
66 public void setAuthScopeHost(String autoScopeHost) {
67 this.authScopeHost = autoScopeHost;
68 }
69
70
71
72
73 public int getAuthScopePort() {
74 return authScopePort;
75 }
76
77
78
79
80 public void setAuthScopePort(int authScopePort) {
81 this.authScopePort = authScopePort;
82 }
83
84
85
86
87 public String getUserName() {
88 return userName;
89 }
90
91
92
93
94 public void setUserName(String userName) {
95 this.userName = userName;
96 }
97
98
99
100
101 public String getPassword() {
102 return password;
103 }
104
105
106
107
108 public void setPassword(String password) {
109 this.password = password;
110 }
111
112
113
114
115 public String toString() {
116 StringBuilder sb = new StringBuilder();
117
118 sb.append(this.getClass().getName());
119 sb.append(" { ");
120 sb.append("authScopeHost=" + authScopeHost);
121 sb.append(" authScopePort=" + authScopePort);
122 sb.append(" userName=" + userName);
123 sb.append(" password=" + password);
124 sb.append(" }");
125
126 return sb.toString();
127 }
128
129 }