mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-24 13:44:33 +00:00
[AB-60] improving java doc for assignable role module
This commit is contained in:
@@ -34,7 +34,7 @@ public class ConditionServiceBean implements ConditionService {
|
||||
}
|
||||
|
||||
private void verifyConditionContext(ConditionContextInstance contextInstance, SystemCondition condition) {
|
||||
for (ConditionContextVariable conditionContextVariable : condition.getExpectedContext().getExpectedVariables()) {
|
||||
for (ConditionContextVariable conditionContextVariable : condition.getExpectedContext().getRequiredVariables()) {
|
||||
HashMap<String, Object> providedParameters = contextInstance.getParameters();
|
||||
if(!providedParameters.containsKey(conditionContextVariable.getName())) {
|
||||
throw new InvalidConditionParametersException(String.format("Variable %s was not present", conditionContextVariable.getName()));
|
||||
|
||||
@@ -10,5 +10,5 @@ import java.util.List;
|
||||
@Setter
|
||||
@Builder
|
||||
public class ConditionContext {
|
||||
private List<ConditionContextVariable> expectedVariables;
|
||||
private List<ConditionContextVariable> requiredVariables;
|
||||
}
|
||||
|
||||
@@ -8,11 +8,21 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* A wrapper object which contains a list of {@link CompletableFuture futures} of the same type, and a primary {@link CompletableFuture future} which completes, when *all* of the futures complete
|
||||
* @param <T> The return value of the individual {@link CompletableFuture futures}
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Slf4j
|
||||
public class CompletableFutureList<T> {
|
||||
/**
|
||||
* The primary {@link CompletableFuture future} which completes once all futures in the list complete, this will complete erroneously, if any of them do so
|
||||
*/
|
||||
private CompletableFuture<Void> mainFuture;
|
||||
/**
|
||||
* The list of {@link CompletableFuture futures} which are wrapped and should complete.
|
||||
*/
|
||||
private List<CompletableFuture<T>> futures;
|
||||
|
||||
public CompletableFutureList(List<CompletableFuture<T>> futures) {
|
||||
@@ -20,6 +30,10 @@ public class CompletableFutureList<T> {
|
||||
this.futures = futures;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all results of the {@link CompletableFuture futures}, for those who completed, the ones which were not completed successfully are not returned
|
||||
* @return A {@link List list} of objects, which were returned by the {@link CompletableFuture futures}.
|
||||
*/
|
||||
public List<T> getObjects() {
|
||||
List<T> result = new ArrayList<>();
|
||||
futures.forEach(future -> {
|
||||
|
||||
Reference in New Issue
Block a user