[AB-60] improving java doc for assignable role module

This commit is contained in:
Sheldan
2021-03-03 23:51:26 +01:00
parent 373dfac001
commit 9c6333281b
65 changed files with 1357 additions and 210 deletions

View File

@@ -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()));

View File

@@ -10,5 +10,5 @@ import java.util.List;
@Setter
@Builder
public class ConditionContext {
private List<ConditionContextVariable> expectedVariables;
private List<ConditionContextVariable> requiredVariables;
}

View File

@@ -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 -> {