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
Pavlin Radoslavov
2014-10-22 09:59:37 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c8ccbd958ccdd4eccfa27f73a17e111ef60c0665
c8ccbd95
1 parent
e8252bb9
Replaced deep nested "if..else" statement with "switch..case".
No functional changes.
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
core/store/dist/src/main/java/org/onlab/onos/store/intent/impl/DistributedIntentStore.java
core/store/dist/src/main/java/org/onlab/onos/store/intent/impl/DistributedIntentStore.java
View file @
c8ccbd9
...
...
@@ -82,12 +82,28 @@ public class DistributedIntentStore
public
IntentEvent
setState
(
Intent
intent
,
IntentState
state
)
{
IntentId
id
=
intent
.
id
();
states
.
put
(
id
,
state
);
IntentEvent
.
Type
type
=
(
state
==
SUBMITTED
?
IntentEvent
.
Type
.
SUBMITTED
:
(
state
==
INSTALLED
?
IntentEvent
.
Type
.
INSTALLED
:
(
state
==
FAILED
?
IntentEvent
.
Type
.
FAILED
:
state
==
WITHDRAWN
?
IntentEvent
.
Type
.
WITHDRAWN
:
null
)));
return
type
==
null
?
null
:
new
IntentEvent
(
type
,
intent
);
IntentEvent
.
Type
type
=
null
;
switch
(
state
)
{
case
SUBMITTED:
type
=
IntentEvent
.
Type
.
SUBMITTED
;
break
;
case
INSTALLED:
type
=
IntentEvent
.
Type
.
INSTALLED
;
break
;
case
FAILED:
type
=
IntentEvent
.
Type
.
FAILED
;
break
;
case
WITHDRAWN:
type
=
IntentEvent
.
Type
.
WITHDRAWN
;
break
;
default
:
break
;
}
if
(
type
==
null
)
{
return
null
;
}
return
new
IntentEvent
(
type
,
intent
);
}
@Override
...
...
Please
register
or
login
to post a comment