Skip to content

Commit

Permalink
Add getters to the delegating consent services
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandoef committed Feb 8, 2025
1 parent 637a79f commit 51374aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,8 @@ public void completeOperationFailure(
public void setTarget(IConsentService theTarget) {
myTarget = theTarget;
}

public IConsentService getTarget() {
return myTarget;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@
import org.hl7.fhir.instance.model.api.IBaseResource;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Stream;

import static org.apache.commons.collections4.CollectionUtils.isEmpty;

/**
* IConsentService combiner over several delegates with pluggable combination strategy
*/
Expand Down Expand Up @@ -90,4 +93,8 @@ public ConsentOutcome willSeeResource(
return myVoteCombiner.apply(myDelegates.stream()
.map(nextDelegate -> nextDelegate.willSeeResource(theRequestDetails, theResource, theContextServices)));
}

public Collection<IConsentService> getDelegates() {
return isEmpty(myDelegates) ? Collections.emptyList() : Collections.unmodifiableCollection(myDelegates);
}
}

0 comments on commit 51374aa

Please sign in to comment.