Skip to content

Commit

Permalink
Merge pull request #73 from eparovyshnaya/553807
Browse files Browse the repository at this point in the history
553807 - revise permission observatory API
better syntax for lambda usage
Signed-off-by: elena.parovyshnaya [email protected]
  • Loading branch information
eparovyshnaya authored Dec 6, 2019
2 parents aef90fb + a235cac commit 8d71be6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ public BasePermissionObservatory(CheckSchedule schedule, Consumer<Set<LimitedPer
}

public void watch(Iterable<FeaturePermission> permissions) {
onEachPermission(permissions, limited -> observatory.watch(limited));
onEachPermission(permissions, observatory::watch);
}

public void forget(Iterable<FeaturePermission> permissions) {
onEachPermission(permissions, limited -> observatory.forget(limited));
onEachPermission(permissions, observatory::forget);
}

public void open() {
Expand All @@ -53,7 +53,7 @@ public void open() {
private void onEachPermission(Iterable<FeaturePermission> permissions, Consumer<LimitedPermission> action) {
StreamSupport.stream(permissions.spliterator(), false)//
.map(LimitedPermission::new) //
.forEach(limited -> action.accept(limited));
.forEach(action::accept);
}

}

0 comments on commit 8d71be6

Please sign in to comment.