Allow context calculators to define "potential contexts", and use these for tab completions

This commit is contained in:
Luck committed 2019-09-04 22:08:24 +01:00
1 parent 4b793d1f14
commit f0e42c6db6
41 files changed
+321 -26

No files matched your search

@@ -94,4 +94,17 @@ public interface ContextCalculator<T> {
*/
void calculate(@NonNull T target, @NonNull ContextConsumer consumer);
/**
* Gets a {@link ContextSet}, containing some/all of the contexts this
* calculator could potentially submit.
*
* <p>The result of this call is primarily intended on providing
* suggestions to end users when defining permissions.</p>
*
* @return a set of potential contexts
*/
default ContextSet estimatePotentialContexts() {
return ImmutableContextSet.empty();
}
}