mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
StreamAPIで書き直し
This commit is contained in:
parent
50f00411ca
commit
ea345c45e4
|
@ -19,6 +19,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.CompletionException;
|
import java.util.concurrent.CompletionException;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
@ -147,17 +148,14 @@ public class LacertaApplyTagDialog extends DialogFragment {
|
||||||
logger.debug("getDocumentTagArrayList", "this.registeredTags.size(): " + this.registeredTags.size());
|
logger.debug("getDocumentTagArrayList", "this.registeredTags.size(): " + this.registeredTags.size());
|
||||||
logger.debug("getDocumentTagArrayList", "this.appliedTags.size(): " + this.appliedTags.size());
|
logger.debug("getDocumentTagArrayList", "this.appliedTags.size(): " + this.appliedTags.size());
|
||||||
|
|
||||||
for (int i = 0; i < this.registeredTags.size(); i++) {
|
documentTagArrayList.addAll(this.registeredTags.stream().map(tag -> {
|
||||||
boolean isChecked = false;
|
DocumentTagApplyTagDialogExtendedModel documentTag = new DocumentTagApplyTagDialogExtendedModel(
|
||||||
for (int j = 0; j < this.appliedTags.size(); j++) {
|
new DocumentTag(tag.getId(), tag.getName(), tag.getColor()),
|
||||||
if (this.registeredTags.get(i).getId().equals(this.appliedTags.get(j).getId())) {
|
this.appliedTags.stream().anyMatch(appliedTag -> appliedTag.getId().equals(tag.getId()))
|
||||||
isChecked = true;
|
);
|
||||||
break;
|
return documentTag;
|
||||||
}
|
}).collect(Collectors.toCollection(ArrayList::new)));
|
||||||
}
|
|
||||||
documentTagArrayList.add(new DocumentTagApplyTagDialogExtendedModel(
|
|
||||||
new DocumentTag(this.registeredTags.get(i).getId(), this.registeredTags.get(i).getName(), this.registeredTags.get(i).getColor()), isChecked));
|
|
||||||
}
|
|
||||||
}).join();
|
}).join();
|
||||||
return documentTagArrayList;
|
return documentTagArrayList;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user