diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/columnNameFilters.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/columnNameFilters.kt index 5c9b0d0aef..d1501b2e51 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/columnNameFilters.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/columnNameFilters.kt @@ -7,6 +7,14 @@ import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet +import org.jetbrains.kotlinx.dataframe.util.COL_ENDS_WITH +import org.jetbrains.kotlinx.dataframe.util.COL_ENDS_WITH_REPLACE +import org.jetbrains.kotlinx.dataframe.util.COL_STARTS_WITH +import org.jetbrains.kotlinx.dataframe.util.COL_STARTS_WITH_REPLACE +import org.jetbrains.kotlinx.dataframe.util.ENDS_WITH +import org.jetbrains.kotlinx.dataframe.util.ENDS_WITH_REPLACE +import org.jetbrains.kotlinx.dataframe.util.STARTS_WITH +import org.jetbrains.kotlinx.dataframe.util.STARTS_WITH_REPLACE import kotlin.reflect.KProperty // region ColumnsSelectionDsl @@ -606,17 +614,6 @@ public interface ColumnNameFiltersColumnsSelectionDsl { // region nameStartsWith - @Deprecated("Use nameStartsWith instead", ReplaceWith("this.nameStartsWith(prefix)")) - public fun ColumnSet.startsWith(prefix: CharSequence): TransformableColumnSet = nameStartsWith(prefix) - - @Deprecated("Use nameStartsWith instead", ReplaceWith("this.nameStartsWith(prefix)")) - public fun ColumnsSelectionDsl<*>.startsWith(prefix: CharSequence): TransformableColumnSet<*> = - nameStartsWith(prefix) - - @Deprecated("Use colsNameStartsWith instead", ReplaceWith("this.colsNameStartsWith(prefix)")) - public fun SingleColumn>.startsWith(prefix: CharSequence): TransformableColumnSet<*> = - colsNameStartsWith(prefix) - /** * ## (Cols) Name Starts With * Returns a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing all columns from [this] @@ -850,18 +847,6 @@ public interface ColumnNameFiltersColumnsSelectionDsl { // region nameEndsWith - @Deprecated("Use nameEndsWith instead", ReplaceWith("this.nameEndsWith(suffix)")) - @Suppress("UNCHECKED_CAST") - public fun ColumnSet.endsWith(suffix: CharSequence): TransformableColumnSet = - colsInternal { it.name.endsWith(suffix) } as TransformableColumnSet - - @Deprecated("Use nameEndsWith instead", ReplaceWith("this.nameEndsWith(suffix)")) - public fun ColumnsSelectionDsl<*>.endsWith(suffix: CharSequence): TransformableColumnSet<*> = nameEndsWith(suffix) - - @Deprecated("Use colsNameEndsWith instead", ReplaceWith("this.colsNameEndsWith(suffix)")) - public fun SingleColumn>.endsWith(suffix: CharSequence): TransformableColumnSet<*> = - this.ensureIsColumnGroup().colsInternal { it.name.endsWith(suffix) } - /** * ## (Cols) Name Ends With * Returns a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing all columns from [this] @@ -1090,6 +1075,57 @@ public interface ColumnNameFiltersColumnsSelectionDsl { ): TransformableColumnSet<*> = columnGroup(this).colsNameEndsWith(suffix, ignoreCase) // endregion + + // region deprecations + + @Deprecated( + message = STARTS_WITH, + replaceWith = ReplaceWith(STARTS_WITH_REPLACE), + level = DeprecationLevel.ERROR, + ) + public fun ColumnSet.startsWith(prefix: CharSequence): TransformableColumnSet = nameStartsWith(prefix) + + @Deprecated( + message = STARTS_WITH, + replaceWith = ReplaceWith(STARTS_WITH_REPLACE), + level = DeprecationLevel.ERROR, + ) + public fun ColumnsSelectionDsl<*>.startsWith(prefix: CharSequence): TransformableColumnSet<*> = + nameStartsWith(prefix) + + @Deprecated( + message = COL_STARTS_WITH, + replaceWith = ReplaceWith(COL_STARTS_WITH_REPLACE), + level = DeprecationLevel.ERROR, + ) + public fun SingleColumn>.startsWith(prefix: CharSequence): TransformableColumnSet<*> = + colsNameStartsWith(prefix) + + @Deprecated( + message = ENDS_WITH, + replaceWith = ReplaceWith(ENDS_WITH_REPLACE), + level = DeprecationLevel.ERROR, + ) + @Suppress("UNCHECKED_CAST") + public fun ColumnSet.endsWith(suffix: CharSequence): TransformableColumnSet = + colsInternal { it.name.endsWith(suffix) } as TransformableColumnSet + + @Deprecated( + message = ENDS_WITH, + replaceWith = ReplaceWith(ENDS_WITH_REPLACE), + level = DeprecationLevel.ERROR, + ) + public fun ColumnsSelectionDsl<*>.endsWith(suffix: CharSequence): TransformableColumnSet<*> = nameEndsWith(suffix) + + @Deprecated( + message = COL_ENDS_WITH, + replaceWith = ReplaceWith(COL_ENDS_WITH_REPLACE), + level = DeprecationLevel.ERROR, + ) + public fun SingleColumn>.endsWith(suffix: CharSequence): TransformableColumnSet<*> = + this.ensureIsColumnGroup().colsInternal { it.name.endsWith(suffix) } + + // endregion } // endregion diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt index f705bfb174..115059588e 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt @@ -7,6 +7,22 @@ package org.jetbrains.kotlinx.dataframe.util * Level.ERROR -> Remove */ +// region WARNING in 0.14, ERROR in 0.15 + +private const val MESSAGE_0_15 = "Will be ERROR in 0.15." + +internal const val STARTS_WITH = "Use nameStartsWith() instead. $MESSAGE_0_15" +internal const val STARTS_WITH_REPLACE = "this.nameStartsWith(prefix)" + +internal const val COL_STARTS_WITH = "Use colsNameStartsWith() instead. $MESSAGE_0_15" +internal const val COL_STARTS_WITH_REPLACE = "this.colsNameStartsWith(prefix)" + +internal const val ENDS_WITH = "Use nameEndsWith() instead. $MESSAGE_0_15" +internal const val ENDS_WITH_REPLACE = "this.nameEndsWith(suffix)" + +internal const val COL_ENDS_WITH = "Use colsNameEndsWith() instead. $MESSAGE_0_15" +internal const val COL_ENDS_WITH_REPLACE = "this.colsNameEndsWith(suffix)" + // region WARNING in 0.15, ERROR in 0.16 private const val MESSAGE_0_16 = "Will be ERROR in 0.16."