Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Yuta HIGUCHI
2014-10-06 23:07:56 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
97b8167295cbc007169b2c51dd24014f31905df0
97b81672
1 parent
993d7aad
minor fixes to Endpoint
Change-Id: Ia189d96919adb581a1a345b6f74b027ccf01ad79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
18 deletions
utils/netty/src/main/java/org/onlab/netty/Endpoint.java
utils/netty/src/main/java/org/onlab/netty/Endpoint.java
View file @
97b8167
package
org
.
onlab
.
netty
;
import
java.util.Objects
;
import
com.google.common.base.MoreObjects
;
/**
* Representation of a TCP/UDP communication end point.
*/
...
...
@@ -32,16 +36,15 @@ public class Endpoint {
@Override
public
String
toString
()
{
return
"Endpoint [port="
+
port
+
", host="
+
host
+
"]"
;
return
MoreObjects
.
toStringHelper
(
getClass
())
.
add
(
"port"
,
port
)
.
add
(
"host"
,
host
)
.
toString
();
}
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
1
;
result
=
prime
*
result
+
((
host
==
null
)
?
0
:
host
.
hashCode
());
result
=
prime
*
result
+
port
;
return
result
;
return
Objects
.
hash
(
host
,
port
);
}
@Override
...
...
@@ -55,17 +58,8 @@ public class Endpoint {
if
(
getClass
()
!=
obj
.
getClass
())
{
return
false
;
}
Endpoint
other
=
(
Endpoint
)
obj
;
if
(
host
==
null
)
{
if
(
other
.
host
!=
null
)
{
return
false
;
}
}
else
if
(!
host
.
equals
(
other
.
host
))
{
return
false
;
}
if
(
port
!=
other
.
port
)
{
return
false
;
}
return
true
;
Endpoint
that
=
(
Endpoint
)
obj
;
return
Objects
.
equals
(
this
.
port
,
that
.
port
)
&&
Objects
.
equals
(
this
.
host
,
that
.
host
);
}
}
...
...
Please
register
or
login
to post a comment