File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
src/main/kotlin/io/github/freya022/botcommands/api/core/options/builder Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,13 @@ interface OptionAggregateBuilderContainer<T : OptionAggregateBuilder<T>> {
22
22
fun aggregate (declaredName : String , aggregator : KFunction <* >, block : T .() -> Unit = {})
23
23
}
24
24
25
+ /* *
26
+ * Declares an aggregate creating an instance of the specified [inline class][clazz],
27
+ * which can only accept a single option.
28
+ *
29
+ * @param declaredName Name of the declared parameter which receives the value class
30
+ * @param clazz The inline class type
31
+ */
25
32
fun <T : OptionAggregateBuilder <T >> OptionAggregateBuilderContainer<T>.inlineClassAggregate (
26
33
declaredName : String ,
27
34
clazz : KClass <* >,
@@ -34,4 +41,18 @@ fun <T : OptionAggregateBuilder<T>> OptionAggregateBuilderContainer<T>.inlineCla
34
41
? : throwArgument(aggregatorConstructor, " Constructor must only have one parameter" )
35
42
block(parameterName)
36
43
}
44
+ }
45
+
46
+ /* *
47
+ * Declares an aggregate creating an instance of the specified [inline class][T],
48
+ * which can only accept a single option.
49
+ *
50
+ * @param T The inline class type
51
+ * @param declaredName Name of the declared parameter which receives the value class
52
+ */
53
+ inline fun <reified T : OptionAggregateBuilder <T >> OptionAggregateBuilderContainer<T>.inlineClassAggregate (
54
+ declaredName : String ,
55
+ noinline block : T .(valueName: String ) -> Unit = {},
56
+ ) {
57
+ return inlineClassAggregate(declaredName, T ::class , block)
37
58
}
You can’t perform that action at this time.
0 commit comments