Kotlin / dataframe

Structured data processing in Kotlin
https://kotlin.github.io/dataframe/overview.html
Apache License 2.0
820 stars 58 forks source link

Merge `KeyValueProperty` and `NameValuePair` #659

Open Jolanrensen opened 5 months ago

Jolanrensen commented 5 months ago

Seems like they try to solve the same thing:

DataRowApi.kt:

@DataSchema
public data class NameValuePair<V>(val name: String, val value: V)

KeyValueProperty.kt:

/** A [DataSchema] interface / class can implement this if it represents a map-like data schema (so key: value). */
@DataSchema
public interface KeyValueProperty<T> {
    // needs to be explicitly overridden in @DataSchema interface, otherwise extension functions won't generate (TODO)
    public val key: String

    // needs to be explicitly overridden in @DataSchema interface, otherwise type will be read as `T` and extensions won't generate (TODO)
    @ColumnName("value")
    public val `value`: T
}