From 72943cb22c79ebe24587461304527e9de5856957 Mon Sep 17 00:00:00 2001 From: Speiger Date: Tue, 17 May 2022 18:10:07 +0200 Subject: [PATCH] Added AsyncBuilder for arrays --- .../collections/templates/utils/AsyncBuilder.template | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/builder/resources/speiger/assets/collections/templates/utils/AsyncBuilder.template b/src/builder/resources/speiger/assets/collections/templates/utils/AsyncBuilder.template index 14c8912..4120918 100644 --- a/src/builder/resources/speiger/assets/collections/templates/utils/AsyncBuilder.template +++ b/src/builder/resources/speiger/assets/collections/templates/utils/AsyncBuilder.template @@ -113,6 +113,16 @@ public class ASYNC_BUILDER KEY_GENERIC_TYPE return new ASYNC_BUILDERBRACES(ITERABLES.wrap(iterable)); } + /** + * Helper function that automatically wraps a array into a AsyncBuilder since it forces this collections Iterable. + * @param values that should be wrapped + * @Type(T) + * @return a AsyncBuilder with the values wrapped + */ + public static GENERIC_KEY_BRACES ASYNC_BUILDER KEY_GENERIC_TYPE of(KEY_TYPE...values) { + return new ASYNC_BUILDERBRACES(ARRAY_LIST.wrap(values)); + } + /** * Maps the elements to something else * @param mapper the mapping function