Skip to content

Commit 5aecd88

Browse files
added function signatures
1 parent 1c8064a commit 5aecd88

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/StardustDocs/topics/Utilities-Generation.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ based on the current `DataFrame` schema.
2020

2121
## generateInterfaces
2222

23+
```kotlin
24+
inline fun <reified T> DataFrame<T>.generateInterfaces(): CodeString
25+
26+
fun <T> DataFrame<T>.generateInterfaces(markerName: String): CodeString
27+
```
28+
2329
Generates [`@DataSchema`](schemas.md) interfaces for this `DataFrame`
2430
(including all nested `DataFrame` columns and column groups) as Kotlin interfaces.
2531

@@ -87,6 +93,16 @@ df.cast<_DataFrameType1>().filter { orders.all { orderId >= 102 } }
8793

8894
## generateDataClasses
8995

96+
```kotlin
97+
inline fun <reified T> DataFrame<T>.generateDataClasses(
98+
markerName: String? = null,
99+
extensionProperties: Boolean = false,
100+
visibility: MarkerVisibility = MarkerVisibility.IMPLICIT_PUBLIC,
101+
useFqNames: Boolean = false,
102+
nameNormalizer: NameNormalizer = NameNormalizer.default,
103+
): CodeString
104+
```
105+
90106
Generates Kotlin data classes corresponding to the `DataFrame` schema
91107
(including all nested `DataFrame` columns and column groups).
92108

@@ -152,6 +168,20 @@ val customers: List<Customer> = df.cast<Customer>().toList()
152168

153169
## generateCode
154170

171+
```kotlin
172+
inline fun <reified T> DataFrame<T>.generateCode(
173+
fields: Boolean = true,
174+
extensionProperties: Boolean = true,
175+
): CodeString
176+
177+
fun <T> DataFrame<T>.generateCode(
178+
markerName: String,
179+
fields: Boolean = true,
180+
extensionProperties: Boolean = true,
181+
visibility: MarkerVisibility = MarkerVisibility.IMPLICIT_PUBLIC,
182+
): CodeString
183+
```
184+
155185
Generates a data schema interface as [`generateInterfaces()`](#generateinterfaces),
156186
along with explicit [extension properties](extensionPropertiesApi.md).
157187
Useful if you don't use the [compiler plugin](Compiler-Plugin.md).

0 commit comments

Comments
 (0)