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
Madan Jampani
2014-10-10 15:48:11 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
62169305bffc7a4fed268d27c3063f1a0dccf280
62169305
1 parent
2ff05591
Removed unused class: VersionedValue
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
79 deletions
core/store/dist/src/main/java/org/onlab/onos/store/link/impl/VersionedValue.java
core/store/dist/src/main/java/org/onlab/onos/store/link/impl/VersionedValue.java
deleted
100644 → 0
View file @
2ff0559
package
org
.
onlab
.
onos
.
store
.
link
.
impl
;
import
java.util.Objects
;
import
org.onlab.onos.store.Timestamp
;
// TODO: remove once we stop using this
/**
* Wrapper class for a entity that is versioned
* and can either be up or down.
*
* @param <T> type of the value.
*/
public
class
VersionedValue
<
T
>
{
private
final
T
entity
;
private
final
Timestamp
timestamp
;
private
final
boolean
isUp
;
public
VersionedValue
(
T
entity
,
boolean
isUp
,
Timestamp
timestamp
)
{
this
.
entity
=
entity
;
this
.
isUp
=
isUp
;
this
.
timestamp
=
timestamp
;
}
/**
* Returns the value.
* @return value.
*/
public
T
entity
()
{
return
entity
;
}
/**
* Tells whether the entity is up or down.
* @return true if up, false otherwise.
*/
public
boolean
isUp
()
{
return
isUp
;
}
/**
* Returns the timestamp (version) associated with this entity.
* @return timestamp.
*/
public
Timestamp
timestamp
()
{
return
timestamp
;
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
entity
,
timestamp
,
isUp
);
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
{
return
true
;
}
if
(
obj
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
obj
.
getClass
())
{
return
false
;
}
@SuppressWarnings
(
"unchecked"
)
VersionedValue
<
T
>
that
=
(
VersionedValue
<
T
>)
obj
;
return
Objects
.
equals
(
this
.
entity
,
that
.
entity
)
&&
Objects
.
equals
(
this
.
timestamp
,
that
.
timestamp
)
&&
Objects
.
equals
(
this
.
isUp
,
that
.
isUp
);
}
// Default constructor for serializer
protected
VersionedValue
()
{
this
.
entity
=
null
;
this
.
isUp
=
false
;
this
.
timestamp
=
null
;
}
}
Please
register
or
login
to post a comment