Skip to content

Commit

Permalink
1.0.3: add getRootService(String name) method
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuinden committed Mar 2, 2017
1 parent d84b86f commit 8423a91
Show file tree
Hide file tree
Showing 11 changed files with 127 additions and 110 deletions.
Binary file modified .gradle/2.14.1/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file modified .gradle/2.14.1/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/2.14.1/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file modified .gradle/2.14.1/taskArtifacts/fileSnapshotsToTreeSnapshotsIndex.bin
Binary file not shown.
Binary file modified .gradle/2.14.1/taskArtifacts/taskArtifacts.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
227 changes: 117 additions & 110 deletions .idea/workspace.xml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change log

-Service Tree 1.0.3 (2017-03-02)
--------------------------------
- Added `getRootService(String name)`.

-Service Tree 1.0.2 (2017-03-02)
--------------------------------
- `unregisterRootService(String name)` should return the removed service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ public void registerRootService(String name, Object service) {
root.addService(name, service);
}

public <T> T getRootService(String name) {
// noinspection unchecked
return (T) root.getService(name);
}

public <T> T unregisterRootService(String name) {
// noinspection unchecked
return (T) root.removeService(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public void rootServiceRegisteredIsAccessibleByChildren() {
assertThat(child.getService("SERVICE")).isSameAs(service);
assertThat(node.getService("SERVICE")).isSameAs(service);

assertThat(serviceTree.getRootService("SERVICE")).isSameAs(service);
assertThat(serviceTree.unregisterRootService("SERVICE")).isSameAs(service);

assertThat(child.getService("SERVICE")).isNull();
Expand Down

0 comments on commit 8423a91

Please sign in to comment.