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
Thomas Vachuska
2014-11-11 18:29:24 -0800
Browse Files
Options
Browse Files
Download
Plain Diff
Committed by
Gerrit Code Review
2014-11-11 18:29:24 -0800
Commit
d8aea86250da66ccda03d91da74b2cba3fab86a1
d8aea862
2 parents
52cc9a70
c3df36be
Merge "Refactor: improve null safety by using empty list instead of null"
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
16 deletions
core/api/src/main/java/org/onlab/onos/net/intent/ConnectivityIntent.java
core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java
core/api/src/main/java/org/onlab/onos/net/intent/LinkCollectionIntent.java
core/api/src/main/java/org/onlab/onos/net/intent/MultiPointToSinglePointIntent.java
core/api/src/main/java/org/onlab/onos/net/intent/PathIntent.java
core/api/src/main/java/org/onlab/onos/net/intent/ConnectivityIntent.java
View file @
d8aea86
...
...
@@ -23,6 +23,7 @@ import org.onlab.onos.net.flow.TrafficSelector;
import
org.onlab.onos.net.flow.TrafficTreatment
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.List
;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkNotNull
;
...
...
@@ -61,7 +62,7 @@ public abstract class ConnectivityIntent extends Intent {
Collection
<
NetworkResource
>
resources
,
TrafficSelector
selector
,
TrafficTreatment
treatment
)
{
this
(
id
,
appId
,
resources
,
selector
,
treatment
,
null
);
this
(
id
,
appId
,
resources
,
selector
,
treatment
,
Collections
.
emptyList
()
);
}
/**
...
...
@@ -87,7 +88,7 @@ public abstract class ConnectivityIntent extends Intent {
super
(
id
,
appId
,
resources
);
this
.
selector
=
checkNotNull
(
selector
);
this
.
treatment
=
checkNotNull
(
treatment
);
this
.
constraints
=
c
onstraints
;
this
.
constraints
=
c
heckNotNull
(
constraints
)
;
}
/**
...
...
@@ -97,7 +98,7 @@ public abstract class ConnectivityIntent extends Intent {
super
();
this
.
selector
=
null
;
this
.
treatment
=
null
;
this
.
constraints
=
null
;
this
.
constraints
=
Collections
.
emptyList
()
;
}
/**
...
...
core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java
View file @
d8aea86
...
...
@@ -21,6 +21,7 @@ import org.onlab.onos.net.HostId;
import
org.onlab.onos.net.flow.TrafficSelector
;
import
org.onlab.onos.net.flow.TrafficTreatment
;
import
java.util.Collections
;
import
java.util.List
;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkNotNull
;
...
...
@@ -46,7 +47,7 @@ public final class HostToHostIntent extends ConnectivityIntent {
public
HostToHostIntent
(
ApplicationId
appId
,
HostId
one
,
HostId
two
,
TrafficSelector
selector
,
TrafficTreatment
treatment
)
{
this
(
appId
,
one
,
two
,
selector
,
treatment
,
null
);
this
(
appId
,
one
,
two
,
selector
,
treatment
,
Collections
.
emptyList
()
);
}
/**
...
...
core/api/src/main/java/org/onlab/onos/net/intent/LinkCollectionIntent.java
View file @
d8aea86
...
...
@@ -22,6 +22,7 @@ import org.onlab.onos.net.Link;
import
org.onlab.onos.net.flow.TrafficSelector
;
import
org.onlab.onos.net.flow.TrafficTreatment
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -51,7 +52,7 @@ public final class LinkCollectionIntent extends ConnectivityIntent {
TrafficTreatment
treatment
,
Set
<
Link
>
links
,
ConnectPoint
egressPoint
)
{
this
(
appId
,
selector
,
treatment
,
links
,
egressPoint
,
null
);
this
(
appId
,
selector
,
treatment
,
links
,
egressPoint
,
Collections
.
emptyList
()
);
}
/**
...
...
core/api/src/main/java/org/onlab/onos/net/intent/MultiPointToSinglePointIntent.java
View file @
d8aea86
...
...
@@ -22,6 +22,7 @@ import org.onlab.onos.net.ConnectPoint;
import
org.onlab.onos.net.flow.TrafficSelector
;
import
org.onlab.onos.net.flow.TrafficTreatment
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -55,14 +56,7 @@ public final class MultiPointToSinglePointIntent extends ConnectivityIntent {
TrafficTreatment
treatment
,
Set
<
ConnectPoint
>
ingressPoints
,
ConnectPoint
egressPoint
)
{
super
(
id
(
MultiPointToSinglePointIntent
.
class
,
selector
,
treatment
,
ingressPoints
,
egressPoint
),
appId
,
null
,
selector
,
treatment
);
checkNotNull
(
ingressPoints
);
checkArgument
(!
ingressPoints
.
isEmpty
(),
"Ingress point set cannot be empty"
);
this
.
ingressPoints
=
Sets
.
newHashSet
(
ingressPoints
);
this
.
egressPoint
=
checkNotNull
(
egressPoint
);
this
(
appId
,
selector
,
treatment
,
ingressPoints
,
egressPoint
,
Collections
.
emptyList
());
}
/**
...
...
core/api/src/main/java/org/onlab/onos/net/intent/PathIntent.java
View file @
d8aea86
...
...
@@ -15,6 +15,7 @@
*/
package
org
.
onlab
.
onos
.
net
.
intent
;
import
java.util.Collections
;
import
java.util.List
;
import
com.google.common.base.MoreObjects
;
...
...
@@ -42,9 +43,7 @@ public class PathIntent extends ConnectivityIntent {
*/
public
PathIntent
(
ApplicationId
appId
,
TrafficSelector
selector
,
TrafficTreatment
treatment
,
Path
path
)
{
super
(
id
(
PathIntent
.
class
,
selector
,
treatment
,
path
),
appId
,
resources
(
path
.
links
()),
selector
,
treatment
);
this
.
path
=
path
;
this
(
appId
,
selector
,
treatment
,
path
,
Collections
.
emptyList
());
}
/**
...
...
Please
register
or
login
to post a comment