Methods Summary |
---|
public java.lang.Object | clone()Copies the object contents
Authority retval = new Authority();
try {
retval.setUser(getUser());
retval.setPassword(getPassword());
} catch (IllegalArgumentException e) {
// intentionally ignored
// it shoild be impossible to get here due to getUser()
// and getPassword() return verified values
}
retval.setHostPort(getHostPort());
return retval;
|
public java.lang.String | encode()Returns the host name in encoded form.
StringBuffer retval = new StringBuffer();
if (userInfo != null) {
String user = userInfo.encode();
if (user != null) {
retval.append(user).append(Separators.AT);
}
}
if (hostPort != null) {
retval.append(hostPort.encode());
}
return retval.toString();
|
public boolean | equals(java.lang.Object other)Returns true if the two Objects are equals , false otherwise.
if (!other.getClass().getName().equals(this.getClass().getName())) {
return false;
}
Authority otherAuth = (Authority) other;
if (! this.hostPort.equals(otherAuth.hostPort)) {
return false;
}
if (this.userInfo != null && otherAuth.userInfo != null) {
if (! this.userInfo.equals(otherAuth.userInfo)) {
return false;
}
}
return true;
|
public Host | getHost()Gets the host name.
if (hostPort == null)
return null;
else
return hostPort.getHost();
|
public HostPort | getHostPort()Gets the host and port member.
return hostPort;
|
public java.lang.String | getPassword()Gets the password from the user informatio.
if (userInfo == null) {
return null;
} else {
return userInfo.getPassword();
}
|
public int | getPort()Gets the port.
if (hostPort == null)
return -1;
else
return hostPort.getPort();
|
public java.lang.String | getUser()Gets the user name if it exists.
return (userInfo != null) ? userInfo.getUser() : null;
|
public UserInfo | getUserInfo()Gets the user information memnber.
return userInfo;
|
public void | removePort()Removes the port.
if (hostPort != null) {
hostPort.removePort();
}
|
public void | removeUserInfo()Removes the user information.
userInfo = null;
|
public void | setHost(Host host)Sets the host.
if (hostPort == null) {
hostPort = new HostPort();
}
hostPort.setHost(host);
|
public void | setHostPort(HostPort h)Sets the host and port member.
hostPort = h;
|
public void | setPassword(java.lang.String passwd)Sets the password.
if (userInfo == null) userInfo = new UserInfo();
userInfo.setPassword(passwd);
|
public void | setPort(int port)Sets the port.
if (hostPort == null) {
hostPort = new HostPort();
}
hostPort.setPort(port);
|
public void | setUser(java.lang.String user)Sets the user name of the user information member.
if (userInfo == null) {
userInfo = new UserInfo();
}
userInfo.setUser(user);
|
public void | setUserInfo(UserInfo u)Sets the user information member.
userInfo = u;
|