public final class ConnectionDetails extends Object
for identity semantics.
Constructor and Description |
---|
ConnectionDetails(EndPoint localEndPoint,
EndPoint remoteEndPoint,
boolean isSecure)
Creates a new
ConnectionDetails instance. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other)
Equality.
|
String |
getConnectionIdentity()
Return a
String that represents the connection. |
EndPoint |
getLocalEndPoint()
Accessor.
|
ConnectionDetails |
getOtherEnd()
Return a
ConnectionDetails representing the other
end of the connection. |
EndPoint |
getRemoteEndPoint()
Accessor.
|
int |
hashCode()
Implement
Object.hashCode() . |
boolean |
isSecure()
Accessor.
|
String |
toString()
String representation of the connection.
|
public ConnectionDetails(EndPoint localEndPoint, EndPoint remoteEndPoint, boolean isSecure)
ConnectionDetails
instance.localEndPoint
- Local host and port.remoteEndPoint
- Remote host and port.isSecure
- Whether the connection is secure.IllegalArgumentException
- If local and remote details are the same.public String toString()
public boolean isSecure()
boolean
valuepublic EndPoint getRemoteEndPoint()
String
valuepublic EndPoint getLocalEndPoint()
String
valuepublic boolean equals(Object other)
It follows that cd.equals(cd.getOtherEnd())
is false;
cd.equals(new ConnectionDetails(cd.getLocalEndPoint(),
cd.getRemoteEndPoint(), cd.isSecure)
is false; cd.equals(cd.getOtherEnd().getOtherEnd())
is true.
public int hashCode()
Object.hashCode()
.public String getConnectionIdentity()
String
that represents the connection.
ConnectionDetails
representing either end of the
same connection always return the same thing.public ConnectionDetails getOtherEnd()
ConnectionDetails
representing the other
end of the connection.Copyright © 2000-2014. All Rights Reserved.