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-11-05 18:28:57 -0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4ee9ddbaa18045a8d34a426d207996107f7f2a64
4ee9ddba
1 parent
cea3ba18
add hashCode to ReadRequest
Change-Id: I2e74047ee65bd2122214eeb582efa70a28b1a1f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletions
core/store/dist/src/main/java/org/onlab/onos/store/service/ReadRequest.java
core/store/dist/src/main/java/org/onlab/onos/store/service/ReadRequest.java
View file @
4ee9ddb
...
...
@@ -2,6 +2,8 @@ package org.onlab.onos.store.service;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkNotNull
;
import
java.util.Objects
;
import
com.google.common.base.MoreObjects
;
/**
...
...
@@ -12,7 +14,6 @@ public class ReadRequest {
private
final
String
tableName
;
private
final
String
key
;
/**
* Creates a read request,
* which will retrieve the specified key from the table.
...
...
@@ -53,4 +54,26 @@ public class ReadRequest {
.
add
(
"key"
,
key
)
.
toString
();
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
key
,
tableName
);
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
{
return
true
;
}
if
(
obj
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
obj
.
getClass
())
{
return
false
;
}
ReadRequest
other
=
(
ReadRequest
)
obj
;
return
Objects
.
equals
(
this
.
key
,
other
.
key
)
&&
Objects
.
equals
(
this
.
tableName
,
other
.
tableName
);
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment