Methods Summary |
---|
public boolean | equals(java.lang.Object a)Compares this principal to the specified object. Returns true if the
object passed in matches the principal
represented by the implementation of this interface.
if (a instanceof PrincipalImpl){
for(int i = 0; i < add.length; i++) {
if(add[i].equals ((InetAddress)((PrincipalImpl) a).getAddress()))
return true;
}
return false;
} else {
return false;
}
|
public java.net.InetAddress | getAddress()Returns the Internet Protocol (IP) address for this principal. In case of multiple address, the first one is returned.
return add[0];
|
public java.net.InetAddress[] | getAddresses()Returns the Internet Protocol (IP) address for this principal. In case of multiple address, the first one is returned.
return add;
|
public java.lang.String | getName()Returns the name of this principal.
return add[0].toString();
|
public int | hashCode()Returns a hashcode for this principal.
return add[0].hashCode();
|
public java.lang.String | toString()Returns a string representation of this principal. In case of multiple address, the first one is returned.
return ("PrincipalImpl :"+add[0].toString());
|