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
Sho SHIMIZU
2016-05-19 17:09:59 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
94e8a16212196f984cd37816df2e89e2fc2c0b4b
94e8a162
1 parent
b696358a
Write Javadoc for DiscreteResources
Change-Id: I94442852d889b91801ae334171f6a97b94a0954a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
2 deletions
core/store/dist/src/main/java/org/onosproject/store/resource/impl/DiscreteResources.java
core/store/dist/src/main/java/org/onosproject/store/resource/impl/DiscreteResources.java
View file @
94e8a16
...
...
@@ -22,24 +22,73 @@ import java.util.List;
import
java.util.Optional
;
import
java.util.Set
;
/**
* A common API for a set of discrete resources.
*/
interface
DiscreteResources
{
/**
* Returns an instance representing an empty set.
*
* @return a empty set.
*/
static
DiscreteResources
empty
()
{
return
NonEncodableDiscreteResources
.
empty
();
}
/**
* Look up a discrete resource instance by ID.
*
* @param id id
* @return found instance enclosed by Optional
*/
Optional
<
DiscreteResource
>
lookup
(
DiscreteResourceId
id
);
/**
* Returns a difference set of this instance and the given instance.
*
* @param other other instance
* @return a new DiscreteResources instance representing a difference set
*/
DiscreteResources
difference
(
DiscreteResources
other
);
/**
* Checks that this instance is empty.
*
* @return true if this instance is empty, otherwise false.
*/
boolean
isEmpty
();
/**
* Checks that this instance contains any of the given resources.
*
* @param other resources
* @return true this instance contains a resource included in the given resources,
* otherwise false.
*/
boolean
containsAny
(
List
<
DiscreteResource
>
other
);
// returns a new instance, not mutate the current instance
/**
* Returns a union set of this instance and the given instance.
* Note: This method returns a new instance, not mutate the current instance
*
* @param other other instance
* @return a new DiscreteResources instance representing a union set
*/
DiscreteResources
add
(
DiscreteResources
other
);
// returns a new instance, not mutate the current instance
/**
* Returns a difference set of this instance and the given resources.
* Note: This method returns a new instance, not mutate the current intance.
*
* @param removed resources
* @return a new DiscreteResources instance representing a difference set
*/
DiscreteResources
remove
(
List
<
DiscreteResource
>
removed
);
/**
* Returns all of resources this instance holds.
*
* @return all resources
*/
Set
<
DiscreteResource
>
values
();
}
...
...
Please
register
or
login
to post a comment