diff --git a/.github/workflows/dokka-gh-pages.yml b/.github/workflows/dokka-gh-pages.yml new file mode 100644 index 0000000..5cae7a8 --- /dev/null +++ b/.github/workflows/dokka-gh-pages.yml @@ -0,0 +1,61 @@ +name: Deploy the API documentation to GitHub Pages with Dokka + +on: + push: + branches: [ "release" ] + pull_request: + branches: [ "release" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Set up JDK 8 + uses: actions/setup-java@v4 + with: + java-version: "8" + distribution: "zulu" + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Build the distribution with Gradle Wrapper + run: ./gradlew :dokkaGeneratePublicationHtml + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: build/dokka/html/ + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/kotlin-multiplatform-ci.yml b/.github/workflows/kotlin-multiplatform-ci.yml new file mode 100644 index 0000000..89008e6 --- /dev/null +++ b/.github/workflows/kotlin-multiplatform-ci.yml @@ -0,0 +1,45 @@ +name: CI + +on: + push: + branches: [ "*" ] +# pull_request: +# branches: [ "*" ] + +jobs: + check: + + runs-on: macos-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 8 + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'zulu' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Check with Gradle Wrapper + run: ./gradlew check + + dependency-submission: + + runs-on: macos-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 8 + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'zulu' + + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ddae077 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Change log + +## v0.5.1 / 2024-10-19 + +* enable the iOS targets for the "coroutines" module, which was disabled due to a compiler bug + +## v0.5.0 / 2024-10-19 + +* support the iOS and Wasm JS targets +* add the enum operator functions `+`, `-`, `++`, `--` since `enumEntries` got supported in Kotlin 2.0 +* add `MutableMapStringKeyValueStore` +* add more functions for checking OSs in `com.huanshankeji.os` +* add some `isSorted...` extension functions that the standard library lacks diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..da80987 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +shreckye@gmail.com. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..ca714df --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,23 @@ +# Contributing guidelines + +Hello, thank you for your interest in contributing to our project. + +## Issues and Discussions + +You are welcome to submit issues on bugs or feature requests. If you have questions, please ask them in GitHub Discussions. + +## Pull requests + +If you want to contribute to the code of our project, you are welcome to open pull requests. However, it's always a good idea to open a related issue or talk with us in Discussions first. + +## Development + +Please make sure you have a valid JDK installed. Some projects may require multiple JDKs of different versions. The JDK version we use can be found in the [GitHub Actions workflow files](.github/workflows). + +We recommend developing with IntelliJ IDEA. In IntelliJ IDEA, select the correct [Project SDK in Project Structure](https://www.jetbrains.com/help/idea/project-settings-and-structure.html#project-sdk) and it's recommended to set [Gradle JVM](https://www.jetbrains.com/help/idea/gradle-jvm-selection.html#jvm_settings) to "Project SDK". + +Run the `publishToMavenLocal` Gradle task to publish the libraries to your machine's Maven Local Repository so your projects can depend on the changes you have made, run `check` to ensure our limited number of tests pass. + +## Furthur notice + +We are currently a small team with limited effort. While we may not always implement your requested features, merge your pull requests, or do such things in time, you are always welcome to create your own fork and make any changes you like. diff --git a/README.md b/README.md index a83703f..b98393c 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,11 @@ Huanshankeji's common code libraries in Kotlin -These include a core library to extend the Kotlin language and its standard library, and extension libraries for various Kotlin and Java libraries such as [Λrrow](https://arrow-kt.io/), Coroutines ([docs here](https://kotlinlang.org/docs/coroutines-overview.html) and [repository here](https://github.com/Kotlin/kotlinx.coroutines)), [Exposed](https://github.com/JetBrains/Exposed), [Ktor](https://ktor.io/), [reflection](https://kotlinlang.org/docs/reflection.html), Serialization ([docs here](https://kotlinlang.org/docs/serialization.html) and [repository here](https://github.com/Kotlin/kotlinx.serialization)), [Vert.x](https://vertx.io/), etc. For common extensions for Compose Multiplatform, check out [compose-multiplatform-common](https://github.com/huanshankeji/compose-multiplatform-material/tree/main/compose-multiplatform-common). +These include a core library to extend the Kotlin language and its standard library, and extension libraries for various Kotlin and Java libraries such as [Λrrow](https://arrow-kt.io/), Coroutines ([docs here](https://kotlinlang.org/docs/coroutines-overview.html) and [repository here](https://github.com/Kotlin/kotlinx.coroutines)), [Exposed](https://github.com/JetBrains/Exposed), [Ktor](https://ktor.io/), [reflection](https://kotlinlang.org/docs/reflection.html), Serialization ([docs here](https://kotlinlang.org/docs/serialization.html) and [repository here](https://github.com/Kotlin/kotlinx.serialization)), [Vert.x](https://vertx.io/) (along with extensions for [kotlinx-io](https://github.com/Kotlin/kotlinx-io) and [Okio](https://square.github.io/okio/)), etc. For common extensions for Compose Multiplatform, check out [compose-multiplatform-common](https://github.com/huanshankeji/compose-multiplatform-material/tree/main/compose-multiplatform-common). -Currently supported targets by multiplatform libraries: JVM, JS (browser), iOS (`iosX64`, `iosArm64`, and `iosSimulatorArm64`) (except for the Coroutines module), and Wasm JS. +Currently supported targets by multiplatform libraries: JVM, JS (browser), iOS (`iosX64`, `iosArm64`, and `iosSimulatorArm64`), and Wasm JS. + +[Check out the API documentation here.](https://huanshankeji.github.io/kotlin-common/) ## Maven coordinates diff --git a/arrow/api/kotlin-common-arrow.api b/arrow/api/kotlin-common-arrow.api new file mode 100644 index 0000000..c256e2e --- /dev/null +++ b/arrow/api/kotlin-common-arrow.api @@ -0,0 +1,4 @@ +public final class com/huanshankeji/arrow/core/OptionKt { + public static final fun toOptionUnit (Z)Larrow/core/Option; +} + diff --git a/arrow/api/kotlin-common-arrow.klib.api b/arrow/api/kotlin-common-arrow.klib.api new file mode 100644 index 0000000..eec2059 --- /dev/null +++ b/arrow/api/kotlin-common-arrow.klib.api @@ -0,0 +1,9 @@ +// Klib ABI Dump +// Targets: [iosArm64, iosSimulatorArm64, iosX64, js, wasmJs] +// Rendering settings: +// - Signature version: 2 +// - Show manifest properties: true +// - Show declarations: true + +// Library unique name: +final fun (kotlin/Boolean).com.huanshankeji.arrow.core/toOptionUnit(): arrow.core/Option // com.huanshankeji.arrow.core/toOptionUnit|toOptionUnit@kotlin.Boolean(){}[0] diff --git a/build.gradle.kts b/build.gradle.kts index 1241019..fd4ed1c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,36 @@ +import com.huanshankeji.cpnProject + tasks.wrapper { distributionType = Wrapper.DistributionType.ALL } + +plugins { + id("org.jetbrains.dokka") + id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.16.3" +} + +dependencies { + listOf( + "core", + "net", + "web", + + "arrow", + "coroutines", + "exposed", + "ktor:client", + "reflect", + "serialization", + "vertx", + //"vertx:with-context-receivers", + ).forEach { + dokka(cpnProject(project, ":$it")) + } +} + +apiValidation { + @OptIn(kotlinx.validation.ExperimentalBCVApi::class) + klib { + enabled = true + } +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index bf8774c..6a6f9e2 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -19,4 +19,5 @@ dependencies { implementation(kotlin("gradle-plugin", "2.0.10")) implementation("com.huanshankeji:common-gradle-dependencies:0.8.0-20241016") // don't use a snapshot version in a main branch implementation("com.huanshankeji.team:gradle-plugins:0.6.0") // don't use a snapshot version in a main branch + implementation("org.jetbrains.dokka:dokka-gradle-plugin:2.0.0-Beta") } diff --git a/buildSrc/src/main/kotlin/OptIns.kt b/buildSrc/src/main/kotlin/OptIns.kt new file mode 100644 index 0000000..4a60d6b --- /dev/null +++ b/buildSrc/src/main/kotlin/OptIns.kt @@ -0,0 +1,4 @@ +val optIns = listOf("com.huanshankeji.InternalApi", "com.huanshankeji.ExperimentalApi") + +inline fun forEachOptIn(action: (String) -> Unit) = + optIns.forEach(action) diff --git a/buildSrc/src/main/kotlin/VersionsAndDependencies.kt b/buildSrc/src/main/kotlin/VersionsAndDependencies.kt index 833f96d..0d68021 100644 --- a/buildSrc/src/main/kotlin/VersionsAndDependencies.kt +++ b/buildSrc/src/main/kotlin/VersionsAndDependencies.kt @@ -2,13 +2,15 @@ import com.huanshankeji.CommonDependencies import com.huanshankeji.CommonGradleClasspathDependencies import com.huanshankeji.CommonVersions -val projectVersion = "0.5.1" +val projectVersion = "0.6.0" -val commonVersions = CommonVersions(arrow = "2.0.0-alpha.4") // for Wasm JS +val commonVersions = CommonVersions(arrow = "2.0.0-alpha.4" /* for Wasm JS*/, exposed = "0.56.0") val commonDependencies = CommonDependencies(commonVersions) val commonGradleClasspathDependencies = CommonGradleClasspathDependencies(commonVersions) object DependencyVersions { val protobufPlugin = "0.9.4" val protobuf = "3.25.2" // Not bumped. The version is a bit chaotic. + val kotlinxIo = "0.5.4" + val okio = "3.9.1" } diff --git a/buildSrc/src/main/kotlin/common-conventions.gradle.kts b/buildSrc/src/main/kotlin/common-conventions.gradle.kts index 4241d0e..4d9114e 100644 --- a/buildSrc/src/main/kotlin/common-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/common-conventions.gradle.kts @@ -5,6 +5,7 @@ plugins { id("com.huanshankeji.team.with-group") id("maven-central") id("com.huanshankeji.team.default-github-packages-maven-publish") + id("dokka-convention") } version = projectVersion diff --git a/buildSrc/src/main/kotlin/dokka-convention.gradle.kts b/buildSrc/src/main/kotlin/dokka-convention.gradle.kts new file mode 100644 index 0000000..d214a55 --- /dev/null +++ b/buildSrc/src/main/kotlin/dokka-convention.gradle.kts @@ -0,0 +1,24 @@ +plugins { + id("org.jetbrains.dokka") +} + +dokka { + //moduleName.set("Huanshankeji Kotlin Common") + dokkaSourceSets.all { + //includes.from("README.md") + sourceLink { + //localDirectory.set(file("src/main/kotlin")) + remoteUrl( + "https://github.com/huanshankeji/kotlin-common/tree/v${version}/${ + with(project) { + name.removePrefix(parent!!.name + '-') + } + }" + ) + remoteLineSuffix.set("#L") + } + /*pluginsConfiguration.html { + footerMessage.set("(c) Yongshun Ye") + }*/ + } +} diff --git a/buildSrc/src/main/kotlin/jvm-conventions.gradle.kts b/buildSrc/src/main/kotlin/jvm-conventions.gradle.kts index eb19168..64b1a0b 100644 --- a/buildSrc/src/main/kotlin/jvm-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/jvm-conventions.gradle.kts @@ -1,6 +1,12 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask + plugins { id("common-conventions") id("com.huanshankeji.kotlin-jvm-library-sonatype-ossrh-publish-conventions") } kotlin.jvmToolchain(8) + +tasks.named>("compileKotlin").configure { + forEachOptIn { compilerOptions.freeCompilerArgs.add("-opt-in=$it") } +} diff --git a/buildSrc/src/main/kotlin/multiplatform-conventions.gradle.kts b/buildSrc/src/main/kotlin/multiplatform-conventions.gradle.kts index 49e1d08..6e8500f 100644 --- a/buildSrc/src/main/kotlin/multiplatform-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/multiplatform-conventions.gradle.kts @@ -11,4 +11,10 @@ kotlin { @OptIn(ExperimentalWasmDsl::class) wasmJs() + + sourceSets { + all { + forEachOptIn(languageSettings::optIn) + } + } } diff --git a/core/api/kotlin-common-core.api b/core/api/kotlin-common-core.api new file mode 100644 index 0000000..2d448e1 --- /dev/null +++ b/core/api/kotlin-common-core.api @@ -0,0 +1,147 @@ +public abstract interface class com/huanshankeji/BidirectionalConversion { + public abstract fun from (Ljava/lang/Object;)Ljava/lang/Object; + public abstract fun to (Ljava/lang/Object;)Ljava/lang/Object; +} + +public abstract interface annotation class com/huanshankeji/ExperimentalApi : java/lang/annotation/Annotation { +} + +public final class com/huanshankeji/FunctionImplementationRemovedKt { + public static final fun functionImplementationRemoved ()Ljava/lang/Void; +} + +public abstract interface annotation class com/huanshankeji/InternalApi : java/lang/annotation/Annotation { +} + +public final class com/huanshankeji/LambdasKt { + public static final fun emptyLambda ()Lkotlin/jvm/functions/Function0; + public static final fun lambdaOf (Lkotlin/jvm/functions/Function0;)Lkotlin/jvm/functions/Function0; + public static final fun lambdaOf (Lkotlin/jvm/functions/Function1;)Lkotlin/jvm/functions/Function1; +} + +public abstract interface annotation class com/huanshankeji/Untested : java/lang/annotation/Annotation { +} + +public final class com/huanshankeji/codec/BasicCodecsKt { + public static final fun base64ToBytes (Ljava/lang/String;)[B + public static final fun bigEndianToLong (Ljava/util/List;)J + public static final fun bigEndianToLong ([B)J + public static final fun bigEndianToULong (Ljava/util/List;)J + public static final fun bigEndianToULong-GBYM_sE ([B)J + public static final fun toBase64String ([B)Ljava/lang/String; + public static final fun toBigEndianBytes (J)[B + public static final fun toBigEndianUBytes-VKZWuLQ (J)[B + public static final fun uLongBigEndianShiftOffset (I)I +} + +public final class com/huanshankeji/collections/CollectionsKt { + public static final fun areElementsDistinct (Ljava/util/List;)Z + public static final fun eachCount (Ljava/util/List;)Ljava/util/Map; + public static final fun isSorted (Ljava/lang/Iterable;)Z + public static final fun isSortedBy (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Z + public static final fun isSortedByDescending (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Z + public static final fun isSortedDescending (Ljava/lang/Iterable;)Z + public static final fun isSortedWith (Ljava/lang/Iterable;Ljava/util/Comparator;)Z + public static final fun singleOrNullIfEmpty (Ljava/lang/Iterable;)Ljava/lang/Object; +} + +public final class com/huanshankeji/collections/LexicographicOrderListComparable : java/lang/Comparable { + public fun compareTo (Lcom/huanshankeji/collections/LexicographicOrderListComparable;)I + public synthetic fun compareTo (Ljava/lang/Object;)I + public final fun getList ()Ljava/util/List; +} + +public final class com/huanshankeji/collections/LexicographicOrderListComparableKt { + public static final fun lexicographicOrderComparable (Ljava/util/List;)Lcom/huanshankeji/collections/LexicographicOrderListComparable; +} + +public final class com/huanshankeji/jdbc/JdbcUrlsKt { + public static final fun jdbcUrl (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;)Ljava/lang/String; +} + +public final class com/huanshankeji/kotlin/CallbacksKt { + public static final fun produceInCallback (Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; +} + +public final class com/huanshankeji/kotlin/EnumKt { + public static final fun enumPlus ([Ljava/lang/Enum;Ljava/lang/Enum;I)Ljava/lang/Enum; +} + +public final class com/huanshankeji/kotlin/UseKt { + public static final fun closeFinally (Ljava/lang/Object;Ljava/lang/Throwable;Lkotlin/jvm/functions/Function1;)V + public static final fun use (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; +} + +public final class com/huanshankeji/kotlin/function/parametertypeparameter/NullableUnitReturnTypeParameterFunctionKt { + public static final fun plus (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Lkotlin/jvm/functions/Function1; +} + +public final class com/huanshankeji/kotlin/function/receivertypeparameter/NullableUnitReturnTypeReceiverFunctionKt { + public static final fun plus (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Lkotlin/jvm/functions/Function1; +} + +public final class com/huanshankeji/os/OSKt { + public static final fun getCurrentOS ()Lcom/huanshankeji/os/Os; + public static final fun getSystemOsName ()Ljava/lang/String; + public static final fun isCurrentOsLinux ()Z + public static final fun isCurrentOsMacos ()Z + public static final fun isCurrentOsWindows ()Z + public static final fun isOSLinux ()Z + public static final fun isOsLinux (Ljava/lang/String;)Z + public static final fun isOsMacos (Ljava/lang/String;)Z + public static final fun isOsWindows (Ljava/lang/String;)Z +} + +public final class com/huanshankeji/os/Os : java/lang/Enum { + public static final field Linux Lcom/huanshankeji/os/Os; + public static final field Macos Lcom/huanshankeji/os/Os; + public static final field Windows Lcom/huanshankeji/os/Os; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static fun valueOf (Ljava/lang/String;)Lcom/huanshankeji/os/Os; + public static fun values ()[Lcom/huanshankeji/os/Os; +} + +public final class com/huanshankeji/random/RandomKt { + public static final fun nextByte (Lkotlin/random/Random;)B + public static final fun nextShort (Lkotlin/random/Random;)S + public static final fun nextUByte (Lkotlin/random/Random;)B + public static final fun nextUShort (Lkotlin/random/Random;)I +} + +public final class com/huanshankeji/security/HashFunctionsKt { + public static final fun sha256 ()Ljava/security/MessageDigest; + public static final fun sha256Hash ([B)[B +} + +public final class com/huanshankeji/sequences/SequencesKt { + public static final fun isSorted (Lkotlin/sequences/Sequence;)Z + public static final fun isSortedBy (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Z + public static final fun isSortedByDescending (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Z + public static final fun isSortedDescending (Lkotlin/sequences/Sequence;)Z + public static final fun isSortedWith (Lkotlin/sequences/Sequence;Ljava/util/Comparator;)Z +} + +public final class com/huanshankeji/store/MutableMapStringKeyValueStore : com/huanshankeji/store/StringKeyValueStore { + public fun ()V + public fun (Ljava/util/Map;)V + public synthetic fun (Ljava/util/Map;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun exists (Ljava/lang/String;)Z + public final fun getMutableMap ()Ljava/util/Map; + public fun getNonNull (Ljava/lang/String;)Ljava/lang/String; + public fun getOrNull (Ljava/lang/String;)Ljava/lang/String; + public fun remove (Ljava/lang/String;)V + public fun set (Ljava/lang/String;Ljava/lang/String;)V +} + +public abstract interface class com/huanshankeji/store/StringKeyValueStore { + public abstract fun exists (Ljava/lang/String;)Z + public abstract fun getNonNull (Ljava/lang/String;)Ljava/lang/String; + public abstract fun getOrNull (Ljava/lang/String;)Ljava/lang/String; + public abstract fun remove (Ljava/lang/String;)V + public abstract fun set (Ljava/lang/String;Ljava/lang/String;)V +} + +public final class com/huanshankeji/text/StringsKt { + public static final fun capitalize (Ljava/lang/String;)Ljava/lang/String; +} + diff --git a/core/api/kotlin-common-core.klib.api b/core/api/kotlin-common-core.klib.api new file mode 100644 index 0000000..e4a34a0 --- /dev/null +++ b/core/api/kotlin-common-core.klib.api @@ -0,0 +1,98 @@ +// Klib ABI Dump +// Targets: [iosArm64, iosSimulatorArm64, iosX64, js, wasmJs] +// Rendering settings: +// - Signature version: 2 +// - Show manifest properties: true +// - Show declarations: true + +// Library unique name: +open annotation class com.huanshankeji/ExperimentalApi : kotlin/Annotation { // com.huanshankeji/ExperimentalApi|null[0] + constructor () // com.huanshankeji/ExperimentalApi.|(){}[0] +} + +open annotation class com.huanshankeji/InternalApi : kotlin/Annotation { // com.huanshankeji/InternalApi|null[0] + constructor () // com.huanshankeji/InternalApi.|(){}[0] +} + +open annotation class com.huanshankeji/Untested : kotlin/Annotation { // com.huanshankeji/Untested|null[0] + constructor () // com.huanshankeji/Untested.|(){}[0] +} + +abstract interface <#A: kotlin/Any?, #B: kotlin/Any?> com.huanshankeji/BidirectionalConversion { // com.huanshankeji/BidirectionalConversion|null[0] + abstract fun from(#B): #A // com.huanshankeji/BidirectionalConversion.from|from(1:1){}[0] + abstract fun to(#A): #B // com.huanshankeji/BidirectionalConversion.to|to(1:0){}[0] +} + +abstract interface com.huanshankeji.store/StringKeyValueStore { // com.huanshankeji.store/StringKeyValueStore|null[0] + abstract fun exists(kotlin/String): kotlin/Boolean // com.huanshankeji.store/StringKeyValueStore.exists|exists(kotlin.String){}[0] + abstract fun getNonNull(kotlin/String): kotlin/String // com.huanshankeji.store/StringKeyValueStore.getNonNull|getNonNull(kotlin.String){}[0] + abstract fun getOrNull(kotlin/String): kotlin/String? // com.huanshankeji.store/StringKeyValueStore.getOrNull|getOrNull(kotlin.String){}[0] + abstract fun remove(kotlin/String) // com.huanshankeji.store/StringKeyValueStore.remove|remove(kotlin.String){}[0] + abstract fun set(kotlin/String, kotlin/String) // com.huanshankeji.store/StringKeyValueStore.set|set(kotlin.String;kotlin.String){}[0] +} + +final class <#A: kotlin/Comparable<#A>> com.huanshankeji.collections/LexicographicOrderListComparable : kotlin/Comparable> { // com.huanshankeji.collections/LexicographicOrderListComparable|null[0] + final val list // com.huanshankeji.collections/LexicographicOrderListComparable.list|{}list[0] + final fun (): kotlin.collections/List<#A> // com.huanshankeji.collections/LexicographicOrderListComparable.list.|(){}[0] + + final fun compareTo(com.huanshankeji.collections/LexicographicOrderListComparable<#A>): kotlin/Int // com.huanshankeji.collections/LexicographicOrderListComparable.compareTo|compareTo(com.huanshankeji.collections.LexicographicOrderListComparable<1:0>){}[0] +} + +final class com.huanshankeji.store/MutableMapStringKeyValueStore : com.huanshankeji.store/StringKeyValueStore { // com.huanshankeji.store/MutableMapStringKeyValueStore|null[0] + constructor (kotlin.collections/MutableMap = ...) // com.huanshankeji.store/MutableMapStringKeyValueStore.|(kotlin.collections.MutableMap){}[0] + + final val mutableMap // com.huanshankeji.store/MutableMapStringKeyValueStore.mutableMap|{}mutableMap[0] + final fun (): kotlin.collections/MutableMap // com.huanshankeji.store/MutableMapStringKeyValueStore.mutableMap.|(){}[0] + + final fun exists(kotlin/String): kotlin/Boolean // com.huanshankeji.store/MutableMapStringKeyValueStore.exists|exists(kotlin.String){}[0] + final fun getNonNull(kotlin/String): kotlin/String // com.huanshankeji.store/MutableMapStringKeyValueStore.getNonNull|getNonNull(kotlin.String){}[0] + final fun getOrNull(kotlin/String): kotlin/String? // com.huanshankeji.store/MutableMapStringKeyValueStore.getOrNull|getOrNull(kotlin.String){}[0] + final fun remove(kotlin/String) // com.huanshankeji.store/MutableMapStringKeyValueStore.remove|remove(kotlin.String){}[0] + final fun set(kotlin/String, kotlin/String) // com.huanshankeji.store/MutableMapStringKeyValueStore.set|set(kotlin.String;kotlin.String){}[0] +} + +final fun (kotlin.collections/List<*>).com.huanshankeji.collections/areElementsDistinct(): kotlin/Boolean // com.huanshankeji.collections/areElementsDistinct|areElementsDistinct@kotlin.collections.List<*>(){}[0] +final fun (kotlin.collections/List).com.huanshankeji.codec/bigEndianToLong(): kotlin/Long // com.huanshankeji.codec/bigEndianToLong|bigEndianToLong@kotlin.collections.List(){}[0] +final fun (kotlin.collections/List).com.huanshankeji.codec/bigEndianToULong(): kotlin/ULong // com.huanshankeji.codec/bigEndianToULong|bigEndianToULong@kotlin.collections.List(){}[0] +final fun (kotlin.random/Random).com.huanshankeji.random/nextByte(): kotlin/Byte // com.huanshankeji.random/nextByte|nextByte@kotlin.random.Random(){}[0] +final fun (kotlin.random/Random).com.huanshankeji.random/nextShort(): kotlin/Short // com.huanshankeji.random/nextShort|nextShort@kotlin.random.Random(){}[0] +final fun (kotlin.random/Random).com.huanshankeji.random/nextUByte(): kotlin/UByte // com.huanshankeji.random/nextUByte|nextUByte@kotlin.random.Random(){}[0] +final fun (kotlin.random/Random).com.huanshankeji.random/nextUShort(): kotlin/UInt // com.huanshankeji.random/nextUShort|nextUShort@kotlin.random.Random(){}[0] +final fun (kotlin/ByteArray).com.huanshankeji.codec/bigEndianToLong(): kotlin/Long // com.huanshankeji.codec/bigEndianToLong|bigEndianToLong@kotlin.ByteArray(){}[0] +final fun (kotlin/ByteArray).com.huanshankeji.codec/toBase64String(): kotlin/String // com.huanshankeji.codec/toBase64String|toBase64String@kotlin.ByteArray(){}[0] +final fun (kotlin/Long).com.huanshankeji.codec/toBigEndianBytes(): kotlin/ByteArray // com.huanshankeji.codec/toBigEndianBytes|toBigEndianBytes@kotlin.Long(){}[0] +final fun (kotlin/String).com.huanshankeji.codec/base64ToBytes(): kotlin/ByteArray // com.huanshankeji.codec/base64ToBytes|base64ToBytes@kotlin.String(){}[0] +final fun (kotlin/String).com.huanshankeji.text/capitalize(): kotlin/String // com.huanshankeji.text/capitalize|capitalize@kotlin.String(){}[0] +final fun (kotlin/UByteArray).com.huanshankeji.codec/bigEndianToULong(): kotlin/ULong // com.huanshankeji.codec/bigEndianToULong|bigEndianToULong@kotlin.UByteArray(){}[0] +final fun (kotlin/ULong).com.huanshankeji.codec/toBigEndianUBytes(): kotlin/UByteArray // com.huanshankeji.codec/toBigEndianUBytes|toBigEndianUBytes@kotlin.ULong(){}[0] +final fun <#A: kotlin/Any?> (kotlin.collections/Iterable<#A>).com.huanshankeji.collections/isSortedWith(kotlin/Comparator): kotlin/Boolean // com.huanshankeji.collections/isSortedWith|isSortedWith@kotlin.collections.Iterable<0:0>(kotlin.Comparator){0§}[0] +final fun <#A: kotlin/Any?> (kotlin.collections/Iterable<#A>).com.huanshankeji.collections/singleOrNullIfEmpty(): #A? // com.huanshankeji.collections/singleOrNullIfEmpty|singleOrNullIfEmpty@kotlin.collections.Iterable<0:0>(){0§}[0] +final fun <#A: kotlin/Any?> (kotlin.collections/List<#A>).com.huanshankeji.collections/eachCount(): kotlin.collections/Map<#A, kotlin/Int> // com.huanshankeji.collections/eachCount|eachCount@kotlin.collections.List<0:0>(){0§}[0] +final fun <#A: kotlin/Any?> (kotlin.sequences/Sequence<#A>).com.huanshankeji.sequences/isSortedWith(kotlin/Comparator): kotlin/Boolean // com.huanshankeji.sequences/isSortedWith|isSortedWith@kotlin.sequences.Sequence<0:0>(kotlin.Comparator){0§}[0] +final fun <#A: kotlin/Comparable<#A>> (kotlin.collections/List<#A>).com.huanshankeji.collections/lexicographicOrderComparable(): com.huanshankeji.collections/LexicographicOrderListComparable<#A> // com.huanshankeji.collections/lexicographicOrderComparable|lexicographicOrderComparable@kotlin.collections.List<0:0>(){0§>}[0] +final fun <#A: kotlin/Enum<#A>> com.huanshankeji.kotlin/enumPlus(kotlin/Array<#A>, #A, kotlin/Int): #A // com.huanshankeji.kotlin/enumPlus|enumPlus(kotlin.Array<0:0>;0:0;kotlin.Int){0§>}[0] +final fun com.huanshankeji.codec/uLongBigEndianShiftOffset(kotlin/Int): kotlin/Int // com.huanshankeji.codec/uLongBigEndianShiftOffset|uLongBigEndianShiftOffset(kotlin.Int){}[0] +final fun com.huanshankeji/functionImplementationRemoved(): kotlin/Nothing // com.huanshankeji/functionImplementationRemoved|functionImplementationRemoved(){}[0] +final inline fun <#A: kotlin/Any> com.huanshankeji.kotlin/produceInCallback(kotlin/Function1, kotlin/Unit>): #A // com.huanshankeji.kotlin/produceInCallback|produceInCallback(kotlin.Function1,kotlin.Unit>){0§}[0] +final inline fun <#A: kotlin/Any?, #B: kotlin/Any?> (#A).com.huanshankeji.kotlin/use(kotlin/Function1<#A, #B>, kotlin/Function1<#A, kotlin/Unit>): #B // com.huanshankeji.kotlin/use|use@0:0(kotlin.Function1<0:0,0:1>;kotlin.Function1<0:0,kotlin.Unit>){0§;1§}[0] +final inline fun <#A: kotlin/Any?, #B: kotlin/Any?> com.huanshankeji/lambdaOf(noinline kotlin/Function1<#A, #B>): kotlin/Function1<#A, #B> // com.huanshankeji/lambdaOf|lambdaOf(kotlin.Function1<0:0,0:1>){0§;1§}[0] +final inline fun <#A: kotlin/Any?, #B: kotlin/Comparable<#B>> (kotlin.collections/Iterable<#A>).com.huanshankeji.collections/isSortedBy(crossinline kotlin/Function1<#A, #B?>): kotlin/Boolean // com.huanshankeji.collections/isSortedBy|isSortedBy@kotlin.collections.Iterable<0:0>(kotlin.Function1<0:0,0:1?>){0§;1§>}[0] +final inline fun <#A: kotlin/Any?, #B: kotlin/Comparable<#B>> (kotlin.collections/Iterable<#A>).com.huanshankeji.collections/isSortedByDescending(crossinline kotlin/Function1<#A, #B?>): kotlin/Boolean // com.huanshankeji.collections/isSortedByDescending|isSortedByDescending@kotlin.collections.Iterable<0:0>(kotlin.Function1<0:0,0:1?>){0§;1§>}[0] +final inline fun <#A: kotlin/Any?, #B: kotlin/Comparable<#B>> (kotlin.sequences/Sequence<#A>).com.huanshankeji.sequences/isSortedBy(crossinline kotlin/Function1<#A, #B?>): kotlin/Boolean // com.huanshankeji.sequences/isSortedBy|isSortedBy@kotlin.sequences.Sequence<0:0>(kotlin.Function1<0:0,0:1?>){0§;1§>}[0] +final inline fun <#A: kotlin/Any?, #B: kotlin/Comparable<#B>> (kotlin.sequences/Sequence<#A>).com.huanshankeji.sequences/isSortedByDescending(crossinline kotlin/Function1<#A, #B?>): kotlin/Boolean // com.huanshankeji.sequences/isSortedByDescending|isSortedByDescending@kotlin.sequences.Sequence<0:0>(kotlin.Function1<0:0,0:1?>){0§;1§>}[0] +final inline fun <#A: kotlin/Any?> (#A).com.huanshankeji.kotlin/closeFinally(kotlin/Throwable?, kotlin/Function1<#A, kotlin/Unit>) // com.huanshankeji.kotlin/closeFinally|closeFinally@0:0(kotlin.Throwable?;kotlin.Function1<0:0,kotlin.Unit>){0§}[0] +final inline fun <#A: kotlin/Any?> (kotlin/Function1<#A, kotlin/Unit>?).com.huanshankeji.kotlin.function.parametertypeparameter/plus(noinline kotlin/Function1<#A, kotlin/Unit>?): kotlin/Function1<#A, kotlin/Unit>? // com.huanshankeji.kotlin.function.parametertypeparameter/plus|plus@kotlin.Function1<0:0,kotlin.Unit>?(kotlin.Function1<0:0,kotlin.Unit>?){0§}[0] +final inline fun <#A: kotlin/Any?> (kotlin/Function1<#A, kotlin/Unit>?).com.huanshankeji.kotlin.function.receivertypeparameter/plus(noinline kotlin/Function1<#A, kotlin/Unit>?): kotlin/Function1<#A, kotlin/Unit>? // com.huanshankeji.kotlin.function.receivertypeparameter/plus|plus@kotlin.Function1<0:0,kotlin.Unit>?(kotlin.Function1<0:0,kotlin.Unit>?){0§}[0] +final inline fun <#A: kotlin/Comparable<#A>> (kotlin.collections/Iterable<#A>).com.huanshankeji.collections/isSorted(): kotlin/Boolean // com.huanshankeji.collections/isSorted|isSorted@kotlin.collections.Iterable<0:0>(){0§>}[0] +final inline fun <#A: kotlin/Comparable<#A>> (kotlin.collections/Iterable<#A>).com.huanshankeji.collections/isSortedDescending(): kotlin/Boolean // com.huanshankeji.collections/isSortedDescending|isSortedDescending@kotlin.collections.Iterable<0:0>(){0§>}[0] +final inline fun <#A: kotlin/Comparable<#A>> (kotlin.sequences/Sequence<#A>).com.huanshankeji.sequences/isSorted(): kotlin/Boolean // com.huanshankeji.sequences/isSorted|isSorted@kotlin.sequences.Sequence<0:0>(){0§>}[0] +final inline fun <#A: kotlin/Comparable<#A>> (kotlin.sequences/Sequence<#A>).com.huanshankeji.sequences/isSortedDescending(): kotlin/Boolean // com.huanshankeji.sequences/isSortedDescending|isSortedDescending@kotlin.sequences.Sequence<0:0>(){0§>}[0] +final inline fun <#A: reified kotlin/Enum<#A>> (#A).com.huanshankeji.kotlin/dec(): #A // com.huanshankeji.kotlin/dec|dec@0:0(){0§>}[0] +final inline fun <#A: reified kotlin/Enum<#A>> (#A).com.huanshankeji.kotlin/inc(): #A // com.huanshankeji.kotlin/inc|inc@0:0(){0§>}[0] +final inline fun <#A: reified kotlin/Enum<#A>> (#A).com.huanshankeji.kotlin/minus(kotlin/Int): #A // com.huanshankeji.kotlin/minus|minus@0:0(kotlin.Int){0§>}[0] +final inline fun <#A: reified kotlin/Enum<#A>> (#A).com.huanshankeji.kotlin/plus(kotlin/Int): #A // com.huanshankeji.kotlin/plus|plus@0:0(kotlin.Int){0§>}[0] +final inline fun com.huanshankeji/emptyLambda(): kotlin/Function0 // com.huanshankeji/emptyLambda|emptyLambda(){}[0] +final inline fun com.huanshankeji/lambdaOf(noinline kotlin/Function0): kotlin/Function0 // com.huanshankeji/lambdaOf|lambdaOf(kotlin.Function0){}[0] + +// Targets: [js] +final fun com.huanshankeji.js.commonjs/require(kotlin/String): dynamic // com.huanshankeji.js.commonjs/require|require(kotlin.String){}[0] diff --git a/core/src/commonMain/kotlin/com/huanshankeji/ExperimentalApi.kt b/core/src/commonMain/kotlin/com/huanshankeji/ExperimentalApi.kt new file mode 100644 index 0000000..ab1f412 --- /dev/null +++ b/core/src/commonMain/kotlin/com/huanshankeji/ExperimentalApi.kt @@ -0,0 +1,5 @@ +package com.huanshankeji + +@RequiresOptIn("This API is experimental. It may be changed in the future without notice.", RequiresOptIn.Level.WARNING) +@Retention(AnnotationRetention.BINARY) +annotation class ExperimentalApi diff --git a/core/src/commonMain/kotlin/com/huanshankeji/FunctionImplementationRemoved.kt b/core/src/commonMain/kotlin/com/huanshankeji/FunctionImplementationRemoved.kt new file mode 100644 index 0000000..26b3bf6 --- /dev/null +++ b/core/src/commonMain/kotlin/com/huanshankeji/FunctionImplementationRemoved.kt @@ -0,0 +1,5 @@ +package com.huanshankeji + +@ExperimentalApi +fun functionImplementationRemoved(): Nothing = + throw NotImplementedError("This function's implementation has been removed and the function will be removed too in the future.") diff --git a/core/src/commonMain/kotlin/com/huanshankeji/InternalApi.kt b/core/src/commonMain/kotlin/com/huanshankeji/InternalApi.kt new file mode 100644 index 0000000..1698bd2 --- /dev/null +++ b/core/src/commonMain/kotlin/com/huanshankeji/InternalApi.kt @@ -0,0 +1,4 @@ +package com.huanshankeji + +@RequiresOptIn("This API is internal in Huanshankeji Kotlin Common and should not be used. It may be changed or removed in the future without notice.") +annotation class InternalApi \ No newline at end of file diff --git a/core/src/commonMain/kotlin/com/huanshankeji/kotlin/Use.kt b/core/src/commonMain/kotlin/com/huanshankeji/kotlin/Use.kt index 551baba..93c573b 100644 --- a/core/src/commonMain/kotlin/com/huanshankeji/kotlin/Use.kt +++ b/core/src/commonMain/kotlin/com/huanshankeji/kotlin/Use.kt @@ -1,13 +1,17 @@ package com.huanshankeji.kotlin +import com.huanshankeji.ExperimentalApi import kotlin.contracts.ExperimentalContracts import kotlin.contracts.InvocationKind import kotlin.contracts.contract +// copied and adapted from https://github.com/JetBrains/kotlin/blob/e747a5a9a6070fd2ee0b2fd1fda1de3230c8307f/libraries/stdlib/jvm/src/kotlin/AutoCloseableJVM.kt#L23 + /** * Copied and adapted from [kotlin.use]. */ -@Deprecated("See https://kotlinlang.org/docs/whatsnew20.html#stable-autocloseable-interface") +//@Deprecated("See https://kotlinlang.org/docs/whatsnew20.html#stable-autocloseable-interface") +@ExperimentalApi @OptIn(ExperimentalContracts::class) inline fun T.use(block: (T) -> R, close: T.() -> Unit): R { contract { @@ -27,10 +31,10 @@ inline fun T.use(block: (T) -> R, close: T.() -> Unit): R { /** * Copied and adapted from [kotlin.closeFinally]. */ -@Deprecated("See https://kotlinlang.org/docs/whatsnew20.html#stable-autocloseable-interface") -/*private*/ inline fun T.closeFinally(cause: Throwable?, close: T.() -> Unit) = when { - this == null -> { - } +//@Deprecated("See https://kotlinlang.org/docs/whatsnew20.html#stable-autocloseable-interface") +@PublishedApi +internal inline fun T.closeFinally(cause: Throwable?, close: T.() -> Unit) = when { + this == null -> {} cause == null -> close() else -> try { @@ -38,4 +42,4 @@ inline fun T.use(block: (T) -> R, close: T.() -> Unit): R { } catch (closeException: Throwable) { cause.addSuppressed(closeException) } -} \ No newline at end of file +} diff --git a/core/src/commonMain/kotlin/com/huanshankeji/kotlin/function/parametertypeparameter/NullableUnitReturnTypeParameterFunction.kt b/core/src/commonMain/kotlin/com/huanshankeji/kotlin/function/parametertypeparameter/NullableUnitReturnTypeParameterFunction.kt new file mode 100644 index 0000000..714ef20 --- /dev/null +++ b/core/src/commonMain/kotlin/com/huanshankeji/kotlin/function/parametertypeparameter/NullableUnitReturnTypeParameterFunction.kt @@ -0,0 +1,18 @@ +package com.huanshankeji.kotlin.function.parametertypeparameter + +import com.huanshankeji.ExperimentalApi + +private typealias NullableUnitReturnTypeParameterFunction = ((T) -> Unit)? + +@ExperimentalApi +inline operator fun NullableUnitReturnTypeParameterFunction.plus(noinline other: NullableUnitReturnTypeParameterFunction): NullableUnitReturnTypeParameterFunction = + if (this === null) + other + else if (other === null) + this + else { + { + this@plus(it) + other(it) + } + } diff --git a/core/src/commonMain/kotlin/com/huanshankeji/kotlin/function/receivertypeparameter/NullableUnitReturnTypeReceiverFunction.kt b/core/src/commonMain/kotlin/com/huanshankeji/kotlin/function/receivertypeparameter/NullableUnitReturnTypeReceiverFunction.kt new file mode 100644 index 0000000..6602857 --- /dev/null +++ b/core/src/commonMain/kotlin/com/huanshankeji/kotlin/function/receivertypeparameter/NullableUnitReturnTypeReceiverFunction.kt @@ -0,0 +1,18 @@ +package com.huanshankeji.kotlin.function.receivertypeparameter + +import com.huanshankeji.ExperimentalApi + +private typealias NullableUnitReturnTypeReceiverFunction = (T.() -> Unit)? + +@ExperimentalApi +inline operator fun NullableUnitReturnTypeReceiverFunction.plus(noinline other: NullableUnitReturnTypeReceiverFunction): NullableUnitReturnTypeReceiverFunction = + if (this === null) + other + else if (other === null) + this + else { + { + this@plus() + other() + } + } diff --git a/core/src/jvmMain/kotlin/com/huanshankeji/jdbc/JdbcUrls.kt b/core/src/jvmMain/kotlin/com/huanshankeji/jdbc/JdbcUrls.kt new file mode 100644 index 0000000..7216925 --- /dev/null +++ b/core/src/jvmMain/kotlin/com/huanshankeji/jdbc/JdbcUrls.kt @@ -0,0 +1,4 @@ +package com.huanshankeji.jdbc + +fun jdbcUrl(rdbms: String, host: String, port: Int?, database: String) = + "jdbc:$rdbms://$host${port?.let { ":$it" } ?: ""}/$database" diff --git a/coroutines/api/kotlin-common-coroutines.api b/coroutines/api/kotlin-common-coroutines.api new file mode 100644 index 0000000..e0b9a1d --- /dev/null +++ b/coroutines/api/kotlin-common-coroutines.api @@ -0,0 +1,20 @@ +public final class com/huanshankeji/kotlinx/coroutine/AwaitKt { + public static final fun awaitAny (Ljava/util/Collection;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun awaitAny ([Lkotlinx/coroutines/Deferred;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun awaitAnyAndCancelOthers (Ljava/util/Collection;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun joinAny (Ljava/util/Collection;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun joinAny ([Lkotlinx/coroutines/Job;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public abstract interface class com/huanshankeji/kotlinx/coroutine/CoroutineAutoCloseable { + public abstract fun close (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public final class com/huanshankeji/kotlinx/coroutine/CoroutineAutoCloseableKt { + public static final fun use (Lcom/huanshankeji/kotlinx/coroutine/CoroutineAutoCloseable;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public abstract interface class com/huanshankeji/kotlinx/coroutine/WithCoroutineScope { + public abstract fun getCoroutineScope ()Lkotlinx/coroutines/CoroutineScope; +} + diff --git a/coroutines/api/kotlin-common-coroutines.klib.api b/coroutines/api/kotlin-common-coroutines.klib.api new file mode 100644 index 0000000..9f2be8a --- /dev/null +++ b/coroutines/api/kotlin-common-coroutines.klib.api @@ -0,0 +1,23 @@ +// Klib ABI Dump +// Targets: [iosArm64, iosSimulatorArm64, iosX64, js, wasmJs] +// Rendering settings: +// - Signature version: 2 +// - Show manifest properties: true +// - Show declarations: true + +// Library unique name: +abstract fun interface com.huanshankeji.kotlinx.coroutine/CoroutineAutoCloseable { // com.huanshankeji.kotlinx.coroutine/CoroutineAutoCloseable|null[0] + abstract suspend fun close() // com.huanshankeji.kotlinx.coroutine/CoroutineAutoCloseable.close|close(){}[0] +} + +abstract interface com.huanshankeji.kotlinx.coroutine/WithCoroutineScope { // com.huanshankeji.kotlinx.coroutine/WithCoroutineScope|null[0] + abstract val coroutineScope // com.huanshankeji.kotlinx.coroutine/WithCoroutineScope.coroutineScope|{}coroutineScope[0] + abstract fun (): kotlinx.coroutines/CoroutineScope // com.huanshankeji.kotlinx.coroutine/WithCoroutineScope.coroutineScope.|(){}[0] +} + +final suspend fun (kotlin.collections/Collection).com.huanshankeji.kotlinx.coroutine/joinAny() // com.huanshankeji.kotlinx.coroutine/joinAny|joinAny@kotlin.collections.Collection(){}[0] +final suspend fun <#A: kotlin/Any?> (kotlin.collections/Collection>).com.huanshankeji.kotlinx.coroutine/awaitAny(): #A // com.huanshankeji.kotlinx.coroutine/awaitAny|awaitAny@kotlin.collections.Collection>(){0§}[0] +final suspend fun <#A: kotlin/Any?> (kotlin.collections/Collection>).com.huanshankeji.kotlinx.coroutine/awaitAnyAndCancelOthers(): #A // com.huanshankeji.kotlinx.coroutine/awaitAnyAndCancelOthers|awaitAnyAndCancelOthers@kotlin.collections.Collection>(){0§}[0] +final suspend fun <#A: kotlin/Any?> com.huanshankeji.kotlinx.coroutine/awaitAny(kotlin/Array>...): #A // com.huanshankeji.kotlinx.coroutine/awaitAny|awaitAny(kotlin.Array>...){0§}[0] +final suspend fun com.huanshankeji.kotlinx.coroutine/joinAny(kotlin/Array...) // com.huanshankeji.kotlinx.coroutine/joinAny|joinAny(kotlin.Array...){}[0] +final suspend inline fun <#A: com.huanshankeji.kotlinx.coroutine/CoroutineAutoCloseable?, #B: kotlin/Any?> (#A).com.huanshankeji.kotlinx.coroutine/use(kotlin/Function1<#A, #B>): #B // com.huanshankeji.kotlinx.coroutine/use|use@0:0(kotlin.Function1<0:0,0:1>){0§;1§}[0] diff --git a/coroutines/src/commonMain/kotlin/com/huanshankeji/kotlinx/coroutine/Await.kt b/coroutines/src/commonMain/kotlin/com/huanshankeji/kotlinx/coroutine/Await.kt index 8c4e560..2ce908f 100644 --- a/coroutines/src/commonMain/kotlin/com/huanshankeji/kotlinx/coroutine/Await.kt +++ b/coroutines/src/commonMain/kotlin/com/huanshankeji/kotlinx/coroutine/Await.kt @@ -1,19 +1,23 @@ package com.huanshankeji.kotlinx.coroutine +import com.huanshankeji.ExperimentalApi import kotlinx.coroutines.Deferred import kotlinx.coroutines.Job import kotlinx.coroutines.selects.select +@ExperimentalApi suspend fun awaitAny(vararg deferreds: Deferred): T { require(deferreds.isNotEmpty()) return select { deferreds.forEach { it.onAwait { it } } } } +@ExperimentalApi suspend fun Collection>.awaitAny(): T { require(isNotEmpty()) return select { forEach { it.onAwait { it } } } } +@ExperimentalApi suspend fun Collection>.awaitAnyAndCancelOthers(): T { require(isNotEmpty()) val firstAwaited = select { forEachIndexed { index, deferred -> deferred.onAwait { IndexedValue(index, it) } } } @@ -22,11 +26,13 @@ suspend fun Collection>.awaitAnyAndCancelOthers(): T { return firstAwaited.value } +@ExperimentalApi suspend fun joinAny(vararg jobs: Job) { require(jobs.isNotEmpty()) select { jobs.forEach { it.onJoin { } } } } +@ExperimentalApi suspend fun Collection.joinAny() { require(isNotEmpty()) select { forEach { it.onJoin { } } } diff --git a/coroutines/src/commonMain/kotlin/com/huanshankeji/kotlinx/coroutine/CoroutineAutoCloseable.kt b/coroutines/src/commonMain/kotlin/com/huanshankeji/kotlinx/coroutine/CoroutineAutoCloseable.kt new file mode 100644 index 0000000..febe21a --- /dev/null +++ b/coroutines/src/commonMain/kotlin/com/huanshankeji/kotlinx/coroutine/CoroutineAutoCloseable.kt @@ -0,0 +1,17 @@ +package com.huanshankeji.kotlinx.coroutine + +import com.huanshankeji.ExperimentalApi +import com.huanshankeji.kotlin.use + +/** + * @see AutoCloseable + * Also see https://github.com/Kotlin/kotlinx.coroutines/issues/1191. + * Made a functional interface so that there is no need to add a function like the [AutoCloseable] one. + */ +@ExperimentalApi +fun interface CoroutineAutoCloseable { + suspend fun close() +} + +suspend inline fun T.use(block: (T) -> R): R = + use(block) { this?.close() } diff --git a/exposed/api/kotlin-common-exposed.api b/exposed/api/kotlin-common-exposed.api new file mode 100644 index 0000000..44650dc --- /dev/null +++ b/exposed/api/kotlin-common-exposed.api @@ -0,0 +1,57 @@ +public final class com/huanshankeji/exposed/HelperInsertStatement : org/jetbrains/exposed/sql/statements/InsertStatement { + public fun (Lorg/jetbrains/exposed/sql/Table;Z)V + public synthetic fun (Lorg/jetbrains/exposed/sql/Table;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun getArguments ()Ljava/util/List; + public fun setArguments (Ljava/util/List;)V +} + +public final class com/huanshankeji/exposed/LiteralsKt { + public static final fun getAsterisk ()Lorg/jetbrains/exposed/sql/LiteralOp; +} + +public final class com/huanshankeji/exposed/SliceKt { + public static final fun emptySlice (Lorg/jetbrains/exposed/sql/ColumnSet;)Lorg/jetbrains/exposed/sql/FieldSet; + public static final fun selectEmpty (Lorg/jetbrains/exposed/sql/ColumnSet;)Lorg/jetbrains/exposed/sql/Query; +} + +public final class com/huanshankeji/exposed/StatementsKt { + public static final field SELECT_DSL_DEPRECATION_MESSAGE Ljava/lang/String; + public static final fun defaultColumnsForInsertSelect (Lorg/jetbrains/exposed/sql/Table;)Ljava/util/List; + public static final fun deleteAllStatement (Lorg/jetbrains/exposed/sql/Table;)Lorg/jetbrains/exposed/sql/statements/DeleteStatement; + public static final fun deleteIgnoreWhereStatement (Lorg/jetbrains/exposed/sql/Table;Ljava/lang/Integer;Ljava/lang/Long;Lkotlin/jvm/functions/Function2;)Lorg/jetbrains/exposed/sql/statements/DeleteStatement; + public static synthetic fun deleteIgnoreWhereStatement$default (Lorg/jetbrains/exposed/sql/Table;Ljava/lang/Integer;Ljava/lang/Long;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lorg/jetbrains/exposed/sql/statements/DeleteStatement; + public static final fun deleteWhereStatement (Lorg/jetbrains/exposed/sql/Table;Ljava/lang/Integer;Ljava/lang/Long;Lkotlin/jvm/functions/Function2;)Lorg/jetbrains/exposed/sql/statements/DeleteStatement; + public static final fun deleteWhereStatement (Lorg/jetbrains/exposed/sql/Table;Lorg/jetbrains/exposed/sql/Op;ZLjava/lang/Integer;Ljava/lang/Long;)Lorg/jetbrains/exposed/sql/statements/DeleteStatement; + public static synthetic fun deleteWhereStatement$default (Lorg/jetbrains/exposed/sql/Table;Ljava/lang/Integer;Ljava/lang/Long;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lorg/jetbrains/exposed/sql/statements/DeleteStatement; + public static synthetic fun deleteWhereStatement$default (Lorg/jetbrains/exposed/sql/Table;Lorg/jetbrains/exposed/sql/Op;ZLjava/lang/Integer;Ljava/lang/Long;ILjava/lang/Object;)Lorg/jetbrains/exposed/sql/statements/DeleteStatement; + public static final fun insertIgnoreStatement (Lorg/jetbrains/exposed/sql/Table;Lkotlin/jvm/functions/Function2;)Lcom/huanshankeji/exposed/HelperInsertStatement; + public static final fun insertSelectStatement (Lorg/jetbrains/exposed/sql/Table;Lorg/jetbrains/exposed/sql/AbstractQuery;Ljava/util/List;Z)Lorg/jetbrains/exposed/sql/statements/InsertSelectStatement; + public static synthetic fun insertSelectStatement$default (Lorg/jetbrains/exposed/sql/Table;Lorg/jetbrains/exposed/sql/AbstractQuery;Ljava/util/List;ZILjava/lang/Object;)Lorg/jetbrains/exposed/sql/statements/InsertSelectStatement; + public static final fun insertStatement (Lorg/jetbrains/exposed/sql/Table;Lkotlin/jvm/functions/Function2;)Lcom/huanshankeji/exposed/HelperInsertStatement; + public static final fun replaceStatement (Lorg/jetbrains/exposed/sql/Table;Lkotlin/jvm/functions/Function2;)Lorg/jetbrains/exposed/sql/statements/ReplaceStatement; + public static final fun selectAllStatement (Lorg/jetbrains/exposed/sql/FieldSet;)Lorg/jetbrains/exposed/sql/Query; + public static final fun selectStatement (Lorg/jetbrains/exposed/sql/ColumnSet;Ljava/util/List;)Lorg/jetbrains/exposed/sql/Query; + public static final fun selectStatement (Lorg/jetbrains/exposed/sql/ColumnSet;Lorg/jetbrains/exposed/sql/Expression;[Lorg/jetbrains/exposed/sql/Expression;)Lorg/jetbrains/exposed/sql/Query; + public static final fun selectStatement (Lorg/jetbrains/exposed/sql/FieldSet;Lkotlin/jvm/functions/Function1;)Lorg/jetbrains/exposed/sql/Query; + public static final fun selectStatement (Lorg/jetbrains/exposed/sql/FieldSet;Lorg/jetbrains/exposed/sql/Op;)Lorg/jetbrains/exposed/sql/Query; + public static final fun selectStatementTableAware (Lorg/jetbrains/exposed/sql/FieldSet;Lkotlin/jvm/functions/Function1;)Lorg/jetbrains/exposed/sql/Query; + public static final fun updateStatement (Lorg/jetbrains/exposed/sql/Table;Lkotlin/jvm/functions/Function1;Ljava/lang/Integer;Lkotlin/jvm/functions/Function2;)Lorg/jetbrains/exposed/sql/statements/UpdateStatement; + public static synthetic fun updateStatement$default (Lorg/jetbrains/exposed/sql/Table;Lkotlin/jvm/functions/Function1;Ljava/lang/Integer;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lorg/jetbrains/exposed/sql/statements/UpdateStatement; + public static final fun updateStatementTableAware (Lorg/jetbrains/exposed/sql/Table;Lkotlin/jvm/functions/Function1;Ljava/lang/Integer;Lkotlin/jvm/functions/Function2;)Lorg/jetbrains/exposed/sql/statements/UpdateStatement; + public static synthetic fun updateStatementTableAware$default (Lorg/jetbrains/exposed/sql/Table;Lkotlin/jvm/functions/Function1;Ljava/lang/Integer;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lorg/jetbrains/exposed/sql/statements/UpdateStatement; + public static final fun updateStatementWithWhereOp (Lorg/jetbrains/exposed/sql/Table;Lorg/jetbrains/exposed/sql/Op;Ljava/lang/Integer;Lkotlin/jvm/functions/Function2;)Lorg/jetbrains/exposed/sql/statements/UpdateStatement; + public static synthetic fun updateStatementWithWhereOp$default (Lorg/jetbrains/exposed/sql/Table;Lorg/jetbrains/exposed/sql/Op;Ljava/lang/Integer;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lorg/jetbrains/exposed/sql/statements/UpdateStatement; +} + +public final class com/huanshankeji/exposed/debug/DebugUpdateBuilderWrapper : org/jetbrains/exposed/sql/statements/UpdateBuilder { + public fun (Lorg/jetbrains/exposed/sql/statements/UpdateBuilder;Ljava/io/PrintStream;)V + public synthetic fun (Lorg/jetbrains/exposed/sql/statements/UpdateBuilder;Ljava/io/PrintStream;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun arguments ()Ljava/lang/Iterable; + public fun executeInternal (Lorg/jetbrains/exposed/sql/statements/api/PreparedStatementApi;Lorg/jetbrains/exposed/sql/Transaction;)Ljava/lang/Object; + public final fun getOut ()Ljava/io/PrintStream; + public final fun getUpdateBuilder ()Lorg/jetbrains/exposed/sql/statements/UpdateBuilder; + public fun prepareSQL (Lorg/jetbrains/exposed/sql/Transaction;Z)Ljava/lang/String; + public fun set (Lorg/jetbrains/exposed/sql/Column;Ljava/lang/Object;)V + public fun set (Lorg/jetbrains/exposed/sql/Column;Lorg/jetbrains/exposed/sql/Query;)V +} + diff --git a/exposed/build.gradle.kts b/exposed/build.gradle.kts index b8cf5d6..1be3561 100644 --- a/exposed/build.gradle.kts +++ b/exposed/build.gradle.kts @@ -1,8 +1,12 @@ +import com.huanshankeji.cpnProject + plugins { id("jvm-conventions") } dependencies { + implementation(cpnProject(project, ":core")) // for the `@Untested` annotation + implementation(commonDependencies.exposed.core()) testImplementation(kotlin("test")) } diff --git a/exposed/src/main/kotlin/com/huanshankeji/exposed/Slice.kt b/exposed/src/main/kotlin/com/huanshankeji/exposed/Slice.kt index 5a27441..3522fc4 100644 --- a/exposed/src/main/kotlin/com/huanshankeji/exposed/Slice.kt +++ b/exposed/src/main/kotlin/com/huanshankeji/exposed/Slice.kt @@ -1,5 +1,6 @@ package com.huanshankeji.exposed +import com.huanshankeji.Untested import org.jetbrains.exposed.sql.ColumnSet /** @@ -8,4 +9,9 @@ import org.jetbrains.exposed.sql.ColumnSet */ @Deprecated("This causes \"java.lang.IllegalArgumentException: Can't prepare SELECT statement without columns or expressions to retrieve\" in the latest version of Exposed.") fun ColumnSet.emptySlice() = + @Suppress("DEPRECATION_ERROR") slice(emptyList()) + +@Untested +fun ColumnSet.selectEmpty() = + select(emptyList()) diff --git a/exposed/src/main/kotlin/com/huanshankeji/exposed/Statements.kt b/exposed/src/main/kotlin/com/huanshankeji/exposed/Statements.kt index 73b4f8e..ee68b8d 100644 --- a/exposed/src/main/kotlin/com/huanshankeji/exposed/Statements.kt +++ b/exposed/src/main/kotlin/com/huanshankeji/exposed/Statements.kt @@ -1,24 +1,63 @@ +@file:OptIn(InternalApi::class) + package com.huanshankeji.exposed +import com.huanshankeji.InternalApi import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.statements.* +@InternalApi +const val SELECT_DSL_DEPRECATION_MESSAGE = + "As part of Exposed SELECT DSL design changes, this will be removed in future releases." + // The select queries are not executed eagerly so just use them directly. /** * Adapted from [org.jetbrains.exposed.sql.select]. */ +@Deprecated( + SELECT_DSL_DEPRECATION_MESSAGE, + ReplaceWith("selectAllStatement().where(where)") +) fun FieldSet.selectStatement(where: WhereOp): Query = + @Suppress("DEPRECATION_ERROR") select(where) /** * Adapted from [org.jetbrains.exposed.sql.select]. */ +@Deprecated( + SELECT_DSL_DEPRECATION_MESSAGE, + ReplaceWith("selectAllStatement().where(where)") +) fun FieldSet.selectStatement(where: BuildWhere): Query = + @Suppress("DEPRECATION_ERROR") select(where) +@Deprecated( + SELECT_DSL_DEPRECATION_MESSAGE, + ReplaceWith("selectAllStatement().where(where)") +) fun T.selectStatementTableAware(where: TableAwareBuildWhere): Query = selectStatement(where()) +/** + * You can also just use [selectAll]. + */ +fun FieldSet.selectAllStatement() = + selectAll() + +/** + * You can also just use [select]. + */ +fun ColumnSet.selectStatement(columns: List>) = + select(columns) + +/** + * You can also just use [select]. + */ +fun ColumnSet.selectStatement(column: Expression<*>, vararg columns: Expression<*>): Query = + select(column, *columns) + /** * @see org.jetbrains.exposed.sql.deleteAll */ @@ -30,15 +69,6 @@ fun Table.deleteWhereStatement( ): DeleteStatement = DeleteStatement(this, op, isIgnore, limit, offset) -/** - * Adapted from [org.jetbrains.exposed.sql.deleteWhere]. - */ -@Deprecated("Use the new table-aware APIs. See https://github.com/JetBrains/Exposed/commit/b9b53f8bbdfbf8cbab56d5602f92543e2ccd473c.") -fun Table.deleteWhereStatement( - isIgnore: Boolean = false, limit: Int? = null, offset: Long? = null, op: BuildWhere -): DeleteStatement = - DeleteStatement(this, SqlExpressionBuilder.op(), isIgnore, limit, offset) - /** * Adapted from [org.jetbrains.exposed.sql.deleteWhere]. */ diff --git a/exposed/src/main/kotlin/com/huanshankeji/exposed/Where.kt b/exposed/src/main/kotlin/com/huanshankeji/exposed/Where.kt index 5c50275..19eb21f 100644 --- a/exposed/src/main/kotlin/com/huanshankeji/exposed/Where.kt +++ b/exposed/src/main/kotlin/com/huanshankeji/exposed/Where.kt @@ -5,7 +5,7 @@ import org.jetbrains.exposed.sql.Op import org.jetbrains.exposed.sql.SqlExpressionBuilder typealias BuildWhere = SqlExpressionBuilder.() -> Op -@Deprecated("Renamed to `WhereBuilder`", ReplaceWith("BuildWhere")) +@Deprecated("Renamed to `WhereBuilder`", ReplaceWith("BuildWhere"/*, "com.huanshankeji.exposed.BuildWhere"*/)) typealias Where = BuildWhere typealias WhereOp = Op typealias TableAwareBuildWhere = T.() -> Op diff --git a/gradle.properties b/gradle.properties index 2dcadc5..5fc7d29 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,5 @@ kotlin.mpp.stability.nowarn=true +# needed for the GitHub Actions CI +org.gradle.jvmargs=-Xmx4G +# for Dokka +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled diff --git a/ktor/client/api/kotlin-common-ktor-client.api b/ktor/client/api/kotlin-common-ktor-client.api new file mode 100644 index 0000000..e69de29 diff --git a/ktor/client/api/kotlin-common-ktor-client.klib.api b/ktor/client/api/kotlin-common-ktor-client.klib.api new file mode 100644 index 0000000..1ce3f86 --- /dev/null +++ b/ktor/client/api/kotlin-common-ktor-client.klib.api @@ -0,0 +1,10 @@ +// Klib ABI Dump +// Targets: [iosArm64, iosSimulatorArm64, iosX64, js, wasmJs] +// Rendering settings: +// - Signature version: 2 +// - Show manifest properties: true +// - Show declarations: true + +// Library unique name: +// Targets: [js] +final fun com.huanshankeji.ktor.client/addCredentialsIncludeToFetch(): dynamic // com.huanshankeji.ktor.client/addCredentialsIncludeToFetch|addCredentialsIncludeToFetch(){}[0] diff --git a/net/api/kotlin-common-net.api b/net/api/kotlin-common-net.api new file mode 100644 index 0000000..25a483e --- /dev/null +++ b/net/api/kotlin-common-net.api @@ -0,0 +1,10 @@ +public final class com/huanshankeji/net/ConstantsKt { + public static final field LOCALHOST Ljava/lang/String; +} + +public final class com/huanshankeji/net/HostAndPort { + public fun (Ljava/lang/String;I)V + public final fun getHost ()Ljava/lang/String; + public final fun getPort ()I +} + diff --git a/net/api/kotlin-common-net.klib.api b/net/api/kotlin-common-net.klib.api new file mode 100644 index 0000000..da36083 --- /dev/null +++ b/net/api/kotlin-common-net.klib.api @@ -0,0 +1,19 @@ +// Klib ABI Dump +// Targets: [iosArm64, iosSimulatorArm64, iosX64, js, wasmJs] +// Rendering settings: +// - Signature version: 2 +// - Show manifest properties: true +// - Show declarations: true + +// Library unique name: +final class com.huanshankeji.net/HostAndPort { // com.huanshankeji.net/HostAndPort|null[0] + constructor (kotlin/String, kotlin/Int) // com.huanshankeji.net/HostAndPort.|(kotlin.String;kotlin.Int){}[0] + + final val host // com.huanshankeji.net/HostAndPort.host|{}host[0] + final fun (): kotlin/String // com.huanshankeji.net/HostAndPort.host.|(){}[0] + final val port // com.huanshankeji.net/HostAndPort.port|{}port[0] + final fun (): kotlin/Int // com.huanshankeji.net/HostAndPort.port.|(){}[0] +} + +final const val com.huanshankeji.net/LOCALHOST // com.huanshankeji.net/LOCALHOST|{}LOCALHOST[0] + final fun (): kotlin/String // com.huanshankeji.net/LOCALHOST.|(){}[0] diff --git a/reflect/api/kotlin-common-reflect.api b/reflect/api/kotlin-common-reflect.api new file mode 100644 index 0000000..ec3d806 --- /dev/null +++ b/reflect/api/kotlin-common-reflect.api @@ -0,0 +1,104 @@ +public final class com/huanshankeji/kotlin/reflect/ConcreteReturnTypeProperty1 { + public fun (Lkotlin/reflect/KProperty1;Lkotlin/reflect/KType;)V + public final fun component1 ()Lkotlin/reflect/KProperty1; + public final fun component2 ()Lkotlin/reflect/KType; + public final fun copy (Lkotlin/reflect/KProperty1;Lkotlin/reflect/KType;)Lcom/huanshankeji/kotlin/reflect/ConcreteReturnTypeProperty1; + public static synthetic fun copy$default (Lcom/huanshankeji/kotlin/reflect/ConcreteReturnTypeProperty1;Lkotlin/reflect/KProperty1;Lkotlin/reflect/KType;ILjava/lang/Object;)Lcom/huanshankeji/kotlin/reflect/ConcreteReturnTypeProperty1; + public fun equals (Ljava/lang/Object;)Z + public final fun getConcreteReturnType ()Lkotlin/reflect/KType; + public final fun getConcreteReturnTypeTypeAndClass ()Lcom/huanshankeji/kotlin/reflect/TypeAndClass; + public final fun getProperty ()Lkotlin/reflect/KProperty1; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class com/huanshankeji/kotlin/reflect/KTypeKt { + public static final fun getNothingType ()Lkotlin/reflect/KType; + public static final fun getNullableNothingType ()Lkotlin/reflect/KType; + public static final fun isConcreteType (Lkotlin/reflect/KType;)Z + public static final fun isConcreteTypeWithAllActualKClasses (Lkotlin/reflect/KType;)Z + public static final fun isNothing (Lkotlin/reflect/KType;)Z + public static final fun isNullableNothing (Lkotlin/reflect/KType;)Z + public static final fun throwNotAClassOrATypeParameter (Lkotlin/reflect/KClassifier;)Ljava/lang/Void; + public static final fun throwStarProjectionsNotSupported ()Ljava/lang/Void; +} + +public final class com/huanshankeji/kotlin/reflect/KTypeSubstitutionKt { + public static final fun substitute (Lkotlin/reflect/KType;Ljava/util/Map;)Lkotlin/reflect/KType; +} + +public final class com/huanshankeji/kotlin/reflect/KTypeUnificationKt { + public static final fun concreteTypeUnify (Lkotlin/reflect/KType;Lkotlin/reflect/KType;)Ljava/util/Map; +} + +public final class com/huanshankeji/kotlin/reflect/KType_jvmKt { + public static final fun copyWithArguments (Lkotlin/reflect/KType;Ljava/util/List;)Lkotlin/reflect/KType; +} + +public final class com/huanshankeji/kotlin/reflect/PropertyTypeParameterInferenceKt { + public static final fun concreteReturnTypeMemberProperties (Lcom/huanshankeji/kotlin/reflect/TypeAndClass;)Ljava/util/List; +} + +public final class com/huanshankeji/kotlin/reflect/ReadableStringKt { + public static final fun toReadableStringByReflection (Ljava/lang/Object;)Ljava/lang/String; +} + +public final class com/huanshankeji/kotlin/reflect/SealedKt { + public static final fun sealedLeafSubclasses (Lkotlin/reflect/KClass;)Ljava/util/List; +} + +public final class com/huanshankeji/kotlin/reflect/SubclassTypeParameterInferenceKt { + public static final fun concreteTypeSealedDirectSubtypes (Lcom/huanshankeji/kotlin/reflect/TypeAndClass;)Ljava/util/List; + public static final fun concreteTypeSealedDirectSubtypesWithAllActualKClasses (Lcom/huanshankeji/kotlin/reflect/TypeAndClass;)Ljava/util/List; + public static final fun concreteTypeSealedLeafSubtypes (Lcom/huanshankeji/kotlin/reflect/TypeAndClass;)Ljava/util/List; + public static final fun concreteTypeSealedLeafSubtypesWithAllActualKClasses (Lcom/huanshankeji/kotlin/reflect/TypeAndClass;)Ljava/util/List; + public static final fun inferSubclassType (Lkotlin/reflect/KClass;Lcom/huanshankeji/kotlin/reflect/TypeAndClass;)Lkotlin/reflect/KType; + public static final fun inferSubclassTypeThrowOnFailing (Lkotlin/reflect/KClass;Lcom/huanshankeji/kotlin/reflect/TypeAndClass;)Lkotlin/reflect/KType; +} + +public final class com/huanshankeji/kotlin/reflect/TypeAndClass { + public fun (Lkotlin/reflect/KType;Lkotlin/reflect/KClass;)V + public synthetic fun (Lkotlin/reflect/KType;Lkotlin/reflect/KClass;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Lkotlin/reflect/KType; + public final fun component2 ()Lkotlin/reflect/KClass; + public final fun copy (Lkotlin/reflect/KType;Lkotlin/reflect/KClass;)Lcom/huanshankeji/kotlin/reflect/TypeAndClass; + public static synthetic fun copy$default (Lcom/huanshankeji/kotlin/reflect/TypeAndClass;Lkotlin/reflect/KType;Lkotlin/reflect/KClass;ILjava/lang/Object;)Lcom/huanshankeji/kotlin/reflect/TypeAndClass; + public fun equals (Ljava/lang/Object;)Z + public final fun getClazz ()Lkotlin/reflect/KClass; + public final fun getType ()Lkotlin/reflect/KType; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class com/huanshankeji/kotlin/reflect/fullconcretetype/FullConcreteTypeClass { + public fun (Lcom/huanshankeji/kotlin/reflect/TypeAndClass;Ljava/util/List;Ljava/util/List;)V + public synthetic fun (Lcom/huanshankeji/kotlin/reflect/TypeAndClass;Ljava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Lcom/huanshankeji/kotlin/reflect/TypeAndClass; + public final fun component2 ()Ljava/util/List; + public final fun component3 ()Ljava/util/List; + public final fun copy (Lcom/huanshankeji/kotlin/reflect/TypeAndClass;Ljava/util/List;Ljava/util/List;)Lcom/huanshankeji/kotlin/reflect/fullconcretetype/FullConcreteTypeClass; + public static synthetic fun copy$default (Lcom/huanshankeji/kotlin/reflect/fullconcretetype/FullConcreteTypeClass;Lcom/huanshankeji/kotlin/reflect/TypeAndClass;Ljava/util/List;Ljava/util/List;ILjava/lang/Object;)Lcom/huanshankeji/kotlin/reflect/fullconcretetype/FullConcreteTypeClass; + public fun equals (Ljava/lang/Object;)Z + public final fun getKClass ()Lkotlin/reflect/KClass; + public final fun getKType ()Lkotlin/reflect/KType; + public final fun getMemberProperties ()Ljava/util/List; + public final fun getSealedSubclasses ()Ljava/util/List; + public final fun getTypeAndClass ()Lcom/huanshankeji/kotlin/reflect/TypeAndClass; + public fun hashCode ()I + public final fun sealedLeafSubclasses ()Ljava/util/List; + public fun toString ()Ljava/lang/String; +} + +public final class com/huanshankeji/kotlin/reflect/fullconcretetype/FullConcreteTypeProperty1 { + public final fun component1 ()Lcom/huanshankeji/kotlin/reflect/ConcreteReturnTypeProperty1; + public final fun component2 ()Lcom/huanshankeji/kotlin/reflect/fullconcretetype/FullConcreteTypeClass; + public final fun copy (Lcom/huanshankeji/kotlin/reflect/ConcreteReturnTypeProperty1;Lcom/huanshankeji/kotlin/reflect/fullconcretetype/FullConcreteTypeClass;)Lcom/huanshankeji/kotlin/reflect/fullconcretetype/FullConcreteTypeProperty1; + public static synthetic fun copy$default (Lcom/huanshankeji/kotlin/reflect/fullconcretetype/FullConcreteTypeProperty1;Lcom/huanshankeji/kotlin/reflect/ConcreteReturnTypeProperty1;Lcom/huanshankeji/kotlin/reflect/fullconcretetype/FullConcreteTypeClass;ILjava/lang/Object;)Lcom/huanshankeji/kotlin/reflect/fullconcretetype/FullConcreteTypeProperty1; + public fun equals (Ljava/lang/Object;)Z + public final fun getConcreteReturnTypeProperty1 ()Lcom/huanshankeji/kotlin/reflect/ConcreteReturnTypeProperty1; + public final fun getKProperty ()Lkotlin/reflect/KProperty1; + public final fun getReturnType ()Lcom/huanshankeji/kotlin/reflect/fullconcretetype/FullConcreteTypeClass; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + diff --git a/reflect/api/kotlin-common-reflect.klib.api b/reflect/api/kotlin-common-reflect.klib.api new file mode 100644 index 0000000..66237e1 --- /dev/null +++ b/reflect/api/kotlin-common-reflect.klib.api @@ -0,0 +1,37 @@ +// Klib ABI Dump +// Targets: [iosArm64, iosSimulatorArm64, iosX64, js, wasmJs] +// Rendering settings: +// - Signature version: 2 +// - Show manifest properties: true +// - Show declarations: true + +// Library unique name: +final class <#A: kotlin/Any> com.huanshankeji.kotlin.reflect/TypeAndClass { // com.huanshankeji.kotlin.reflect/TypeAndClass|null[0] + constructor (kotlin.reflect/KType, kotlin.reflect/KClass<#A> = ...) // com.huanshankeji.kotlin.reflect/TypeAndClass.|(kotlin.reflect.KType;kotlin.reflect.KClass<1:0>){}[0] + + final val clazz // com.huanshankeji.kotlin.reflect/TypeAndClass.clazz|{}clazz[0] + final fun (): kotlin.reflect/KClass<#A> // com.huanshankeji.kotlin.reflect/TypeAndClass.clazz.|(){}[0] + final val type // com.huanshankeji.kotlin.reflect/TypeAndClass.type|{}type[0] + final fun (): kotlin.reflect/KType // com.huanshankeji.kotlin.reflect/TypeAndClass.type.|(){}[0] + + final fun component1(): kotlin.reflect/KType // com.huanshankeji.kotlin.reflect/TypeAndClass.component1|component1(){}[0] + final fun component2(): kotlin.reflect/KClass<#A> // com.huanshankeji.kotlin.reflect/TypeAndClass.component2|component2(){}[0] + final fun copy(kotlin.reflect/KType = ..., kotlin.reflect/KClass<#A> = ...): com.huanshankeji.kotlin.reflect/TypeAndClass<#A> // com.huanshankeji.kotlin.reflect/TypeAndClass.copy|copy(kotlin.reflect.KType;kotlin.reflect.KClass<1:0>){}[0] + final fun equals(kotlin/Any?): kotlin/Boolean // com.huanshankeji.kotlin.reflect/TypeAndClass.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // com.huanshankeji.kotlin.reflect/TypeAndClass.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // com.huanshankeji.kotlin.reflect/TypeAndClass.toString|toString(){}[0] +} + +final val com.huanshankeji.kotlin.reflect/nothingType // com.huanshankeji.kotlin.reflect/nothingType|{}nothingType[0] + final fun (): kotlin.reflect/KType // com.huanshankeji.kotlin.reflect/nothingType.|(){}[0] +final val com.huanshankeji.kotlin.reflect/nullableNothingType // com.huanshankeji.kotlin.reflect/nullableNothingType|{}nullableNothingType[0] + final fun (): kotlin.reflect/KType // com.huanshankeji.kotlin.reflect/nullableNothingType.|(){}[0] + +final fun (kotlin.reflect/KType).com.huanshankeji.kotlin.reflect/copyWithArguments(kotlin.collections/List): kotlin.reflect/KType // com.huanshankeji.kotlin.reflect/copyWithArguments|copyWithArguments@kotlin.reflect.KType(kotlin.collections.List){}[0] +final fun (kotlin.reflect/KType).com.huanshankeji.kotlin.reflect/isConcreteType(): kotlin/Boolean // com.huanshankeji.kotlin.reflect/isConcreteType|isConcreteType@kotlin.reflect.KType(){}[0] +final fun (kotlin.reflect/KType).com.huanshankeji.kotlin.reflect/isConcreteTypeWithAllActualKClasses(): kotlin/Boolean // com.huanshankeji.kotlin.reflect/isConcreteTypeWithAllActualKClasses|isConcreteTypeWithAllActualKClasses@kotlin.reflect.KType(){}[0] +final fun (kotlin.reflect/KType).com.huanshankeji.kotlin.reflect/isNothing(): kotlin/Boolean // com.huanshankeji.kotlin.reflect/isNothing|isNothing@kotlin.reflect.KType(){}[0] +final fun (kotlin.reflect/KType).com.huanshankeji.kotlin.reflect/isNullableNothing(): kotlin/Boolean // com.huanshankeji.kotlin.reflect/isNullableNothing|isNullableNothing@kotlin.reflect.KType(){}[0] +final fun com.huanshankeji.kotlin.reflect/throwNotAClassOrATypeParameter(kotlin.reflect/KClassifier?): kotlin/Nothing // com.huanshankeji.kotlin.reflect/throwNotAClassOrATypeParameter|throwNotAClassOrATypeParameter(kotlin.reflect.KClassifier?){}[0] +final fun com.huanshankeji.kotlin.reflect/throwStarProjectionsNotSupported(): kotlin/Nothing // com.huanshankeji.kotlin.reflect/throwStarProjectionsNotSupported|throwStarProjectionsNotSupported(){}[0] +final inline fun <#A: reified kotlin/Any> com.huanshankeji.kotlin.reflect/typeAndClassOf(): com.huanshankeji.kotlin.reflect/TypeAndClass<#A> // com.huanshankeji.kotlin.reflect/typeAndClassOf|typeAndClassOf(){0§}[0] diff --git a/reflect/src/commonTest/kotlin/com/huanshankeji/kotlin/reflect/ConcreteTypeTest.kt b/reflect/src/commonTest/kotlin/com/huanshankeji/kotlin/reflect/ConcreteTypeTest.kt index ee8cdad..226338e 100644 --- a/reflect/src/commonTest/kotlin/com/huanshankeji/kotlin/reflect/ConcreteTypeTest.kt +++ b/reflect/src/commonTest/kotlin/com/huanshankeji/kotlin/reflect/ConcreteTypeTest.kt @@ -7,9 +7,9 @@ import kotlin.test.assertTrue class ConcreteTypeTest { @Test - fun testIsConcreteType() { - assertTrue(typeOf().isConcreteType()) - assertTrue(typeOf>().isConcreteType()) - assertFalse(typeOf>().isConcreteType()) + fun testIsConcreteTypeWithAllActualKClasses() { + assertTrue(typeOf().isConcreteTypeWithAllActualKClasses()) + assertTrue(typeOf>().isConcreteTypeWithAllActualKClasses()) + assertFalse(typeOf>().isConcreteTypeWithAllActualKClasses()) } } \ No newline at end of file diff --git a/reflect/src/jvmMain/kotlin/com/huanshankeji/kotlin/reflect/KTypeUnification.kt b/reflect/src/jvmMain/kotlin/com/huanshankeji/kotlin/reflect/KTypeUnification.kt index 307a904..b940db2 100644 --- a/reflect/src/jvmMain/kotlin/com/huanshankeji/kotlin/reflect/KTypeUnification.kt +++ b/reflect/src/jvmMain/kotlin/com/huanshankeji/kotlin/reflect/KTypeUnification.kt @@ -9,7 +9,7 @@ import kotlin.reflect.KTypeParameter * @return `null` when it fails */ fun concreteTypeUnify(knowConcreteType: KType, typeWithVariables: KType): Substitution? { - require(knowConcreteType.isConcreteType()) + require(knowConcreteType.isConcreteTypeWithAllActualKClasses()) val result = mutableMapOf() return if (doConcreteTypeUnify(knowConcreteType, typeWithVariables, result)) result else null diff --git a/serialization/api/kotlin-common-serialization.api b/serialization/api/kotlin-common-serialization.api new file mode 100644 index 0000000..245bc07 --- /dev/null +++ b/serialization/api/kotlin-common-serialization.api @@ -0,0 +1,60 @@ +public final class com/huanshankeji/kotlinx/serialization/NothingSerializer : kotlinx/serialization/KSerializer { + public static final field INSTANCE Lcom/huanshankeji/kotlinx/serialization/NothingSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Void; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Void;)Ljava/lang/Void; +} + +public final class com/huanshankeji/kotlinx/serialization/NothingWorkaroundKt { + public static final field NOTHING_SUPPORTED_BY_KOTLINX_SERIALIZATION_MESSAGE Ljava/lang/String; + public static final fun mapNothingToSerializableNothing (Lkotlin/reflect/KType;)Lkotlin/reflect/KType; +} + +public final class com/huanshankeji/kotlinx/serialization/SerializableNothing { + public static final field Companion Lcom/huanshankeji/kotlinx/serialization/SerializableNothing$Companion; +} + +public synthetic class com/huanshankeji/kotlinx/serialization/SerializableNothing$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/huanshankeji/kotlinx/serialization/SerializableNothing$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/huanshankeji/kotlinx/serialization/SerializableNothing; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/huanshankeji/kotlinx/serialization/SerializableNothing;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/huanshankeji/kotlinx/serialization/SerializableNothing$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class com/huanshankeji/kotlinx/serialization/VoidSerializer : kotlinx/serialization/KSerializer { + public static final field INSTANCE Lcom/huanshankeji/kotlinx/serialization/VoidSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Void; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Void;)Ljava/lang/Void; +} + +public final class com/huanshankeji/kotlinx/serialization/protobuf/ProtoBufKt { + public static final fun getExtendedProtoBuf ()Lkotlinx/serialization/protobuf/ProtoBuf; +} + +public abstract interface class com/huanshankeji/kotlinx/serialization/protobuf/ProtoBufSumTypeSerializer : kotlinx/serialization/KSerializer { + public abstract fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public abstract fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public abstract fun getSubtypeDeserializationStrategy (I)Lkotlinx/serialization/DeserializationStrategy; + public abstract fun getSubtypeNumberAndSubtypeSerializationStrategy (Ljava/lang/Object;)Lkotlin/Pair; + public abstract fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V +} + +public final class com/huanshankeji/kotlinx/serialization/protobuf/ProtoBufSumTypeSerializer$DefaultImpls { + public static fun deserialize (Lcom/huanshankeji/kotlinx/serialization/protobuf/ProtoBufSumTypeSerializer;Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public static fun getDescriptor (Lcom/huanshankeji/kotlinx/serialization/protobuf/ProtoBufSumTypeSerializer;)Lkotlinx/serialization/descriptors/SerialDescriptor; + public static fun serialize (Lcom/huanshankeji/kotlinx/serialization/protobuf/ProtoBufSumTypeSerializer;Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V +} + diff --git a/serialization/api/kotlin-common-serialization.klib.api b/serialization/api/kotlin-common-serialization.klib.api new file mode 100644 index 0000000..aa9a58e --- /dev/null +++ b/serialization/api/kotlin-common-serialization.klib.api @@ -0,0 +1,52 @@ +// Klib ABI Dump +// Targets: [iosArm64, iosSimulatorArm64, iosX64, js, wasmJs] +// Rendering settings: +// - Signature version: 2 +// - Show manifest properties: true +// - Show declarations: true + +// Library unique name: +abstract interface <#A: kotlin/Any?> com.huanshankeji.kotlinx.serialization.protobuf/ProtoBufSumTypeSerializer : kotlinx.serialization/KSerializer<#A> { // com.huanshankeji.kotlinx.serialization.protobuf/ProtoBufSumTypeSerializer|null[0] + open val descriptor // com.huanshankeji.kotlinx.serialization.protobuf/ProtoBufSumTypeSerializer.descriptor|{}descriptor[0] + open fun (): kotlinx.serialization.descriptors/SerialDescriptor // com.huanshankeji.kotlinx.serialization.protobuf/ProtoBufSumTypeSerializer.descriptor.|(){}[0] + + abstract fun getSubtypeDeserializationStrategy(kotlin/Int): kotlinx.serialization/DeserializationStrategy<*> // com.huanshankeji.kotlinx.serialization.protobuf/ProtoBufSumTypeSerializer.getSubtypeDeserializationStrategy|getSubtypeDeserializationStrategy(kotlin.Int){}[0] + abstract fun getSubtypeNumberAndSubtypeSerializationStrategy(#A): kotlin/Pair> // com.huanshankeji.kotlinx.serialization.protobuf/ProtoBufSumTypeSerializer.getSubtypeNumberAndSubtypeSerializationStrategy|getSubtypeNumberAndSubtypeSerializationStrategy(1:0){}[0] + open fun deserialize(kotlinx.serialization.encoding/Decoder): #A // com.huanshankeji.kotlinx.serialization.protobuf/ProtoBufSumTypeSerializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + open fun serialize(kotlinx.serialization.encoding/Encoder, #A) // com.huanshankeji.kotlinx.serialization.protobuf/ProtoBufSumTypeSerializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;1:0){}[0] +} + +final class com.huanshankeji.kotlinx.serialization/SerializableNothing { // com.huanshankeji.kotlinx.serialization/SerializableNothing|null[0] + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // com.huanshankeji.kotlinx.serialization/SerializableNothing.$serializer|null[0] + final val descriptor // com.huanshankeji.kotlinx.serialization/SerializableNothing.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // com.huanshankeji.kotlinx.serialization/SerializableNothing.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // com.huanshankeji.kotlinx.serialization/SerializableNothing.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): com.huanshankeji.kotlinx.serialization/SerializableNothing // com.huanshankeji.kotlinx.serialization/SerializableNothing.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, com.huanshankeji.kotlinx.serialization/SerializableNothing) // com.huanshankeji.kotlinx.serialization/SerializableNothing.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;com.huanshankeji.kotlinx.serialization.SerializableNothing){}[0] + } + + final object Companion { // com.huanshankeji.kotlinx.serialization/SerializableNothing.Companion|null[0] + final fun serializer(): kotlinx.serialization/KSerializer // com.huanshankeji.kotlinx.serialization/SerializableNothing.Companion.serializer|serializer(){}[0] + } +} + +final object com.huanshankeji.kotlinx.serialization/NothingSerializer : kotlinx.serialization/KSerializer { // com.huanshankeji.kotlinx.serialization/NothingSerializer|null[0] + final val descriptor // com.huanshankeji.kotlinx.serialization/NothingSerializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // com.huanshankeji.kotlinx.serialization/NothingSerializer.descriptor.|(){}[0] + + final fun deserialize(kotlinx.serialization.encoding/Decoder): kotlin/Nothing // com.huanshankeji.kotlinx.serialization/NothingSerializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, kotlin/Nothing): kotlin/Nothing // com.huanshankeji.kotlinx.serialization/NothingSerializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;kotlin.Nothing){}[0] +} + +final const val com.huanshankeji.kotlinx.serialization/NOTHING_SUPPORTED_BY_KOTLINX_SERIALIZATION_MESSAGE // com.huanshankeji.kotlinx.serialization/NOTHING_SUPPORTED_BY_KOTLINX_SERIALIZATION_MESSAGE|{}NOTHING_SUPPORTED_BY_KOTLINX_SERIALIZATION_MESSAGE[0] + final fun (): kotlin/String // com.huanshankeji.kotlinx.serialization/NOTHING_SUPPORTED_BY_KOTLINX_SERIALIZATION_MESSAGE.|(){}[0] + +final fun (kotlin.reflect/KType).com.huanshankeji.kotlinx.serialization/mapNothingToSerializableNothing(): kotlin.reflect/KType // com.huanshankeji.kotlinx.serialization/mapNothingToSerializableNothing|mapNothingToSerializableNothing@kotlin.reflect.KType(){}[0] +final inline fun <#A: reified kotlin/Any?> (kotlinx.serialization.protobuf/ProtoBuf).com.huanshankeji.kotlinx.serialization.protobuf/decodeFromByteArrayNothingWorkaround(kotlin/ByteArray): #A // com.huanshankeji.kotlinx.serialization.protobuf/decodeFromByteArrayNothingWorkaround|decodeFromByteArrayNothingWorkaround@kotlinx.serialization.protobuf.ProtoBuf(kotlin.ByteArray){0§}[0] +final inline fun <#A: reified kotlin/Any?> (kotlinx.serialization.protobuf/ProtoBuf).com.huanshankeji.kotlinx.serialization.protobuf/encodeToByteArrayNothingWorkaround(#A): kotlin/ByteArray // com.huanshankeji.kotlinx.serialization.protobuf/encodeToByteArrayNothingWorkaround|encodeToByteArrayNothingWorkaround@kotlinx.serialization.protobuf.ProtoBuf(0:0){0§}[0] +final inline fun <#A: reified kotlin/Any?> (kotlinx.serialization/SerialFormat).com.huanshankeji.kotlinx.serialization/serializerNothingWorkaround(): kotlinx.serialization/KSerializer<#A> // com.huanshankeji.kotlinx.serialization/serializerNothingWorkaround|serializerNothingWorkaround@kotlinx.serialization.SerialFormat(){0§}[0] + +// Targets: [js] +final val com.huanshankeji.kotlinx.serialization.protobuf/extendedProtoBuf // com.huanshankeji.kotlinx.serialization.protobuf/extendedProtoBuf|{}extendedProtoBuf[0] + final fun (): kotlinx.serialization.protobuf/ProtoBuf // com.huanshankeji.kotlinx.serialization.protobuf/extendedProtoBuf.|(){}[0] diff --git a/serialization/benchmark/api/kotlin-common-serialization-benchmark.api b/serialization/benchmark/api/kotlin-common-serialization-benchmark.api new file mode 100644 index 0000000..1867db6 --- /dev/null +++ b/serialization/benchmark/api/kotlin-common-serialization-benchmark.api @@ -0,0 +1,231 @@ +public abstract class com/huanshankeji/kotlinx/serialization/benchmark/BaseBenchmark { + public fun ()V +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/DataAndSerializersKt { + public static final fun getMaxDefaultLongWrapperDataSerializationConfig ()Lcom/huanshankeji/kotlinx/serialization/benchmark/DataSerializationConfig; + public static final fun getMaxFixedLongWrapperDataSerializationConfig ()Lcom/huanshankeji/kotlinx/serialization/benchmark/DataSerializationConfig; + public static final fun getMaxLongWrapperDataSerializationConfig ()Lcom/huanshankeji/kotlinx/serialization/benchmark/DataSerializationConfig; + public static final fun getTestDataOfNothing ()Lcom/huanshankeji/kotlinx/serialization/benchmark/TestData; + public static final fun getTestDataOfNothingDataSerializationConfig ()Lcom/huanshankeji/kotlinx/serialization/benchmark/DataSerializationConfig; + public static final fun getTestDataOfNothingSerializer ()Lkotlinx/serialization/SerializationStrategy; + public static final fun getZeroDefaultLongWrapperDataSerializationConfig ()Lcom/huanshankeji/kotlinx/serialization/benchmark/DataSerializationConfig; + public static final fun getZeroFixedLongWrapperDataSerializationConfig ()Lcom/huanshankeji/kotlinx/serialization/benchmark/DataSerializationConfig; + public static final fun getZeroLongWrapperDataSerializationConfig ()Lcom/huanshankeji/kotlinx/serialization/benchmark/DataSerializationConfig; +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/DataSerializationConfig { + public fun (Lkotlin/reflect/KType;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)V + public final fun getData ()Ljava/lang/Object; + public final fun getKType ()Lkotlin/reflect/KType; + public final fun getSerializer ()Lkotlinx/serialization/SerializationStrategy; +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/DefaultLongWrapper { + public static final field Companion Lcom/huanshankeji/kotlinx/serialization/benchmark/DefaultLongWrapper$Companion; + public fun (J)V + public final fun getValue ()J +} + +public synthetic class com/huanshankeji/kotlinx/serialization/benchmark/DefaultLongWrapper$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/huanshankeji/kotlinx/serialization/benchmark/DefaultLongWrapper$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/huanshankeji/kotlinx/serialization/benchmark/DefaultLongWrapper; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/huanshankeji/kotlinx/serialization/benchmark/DefaultLongWrapper;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/DefaultLongWrapper$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public class com/huanshankeji/kotlinx/serialization/benchmark/DifferentDataBenchmark : com/huanshankeji/kotlinx/serialization/benchmark/BaseBenchmark { + public field paramEnum Lcom/huanshankeji/kotlinx/serialization/benchmark/DifferentDataParamEnum; + public fun ()V + public fun getParamEnum ()Lcom/huanshankeji/kotlinx/serialization/benchmark/DifferentDataParamEnum; + public fun serializeToJsonWithSerializerFromKType ()Ljava/lang/String; + public fun serializeToJsonWithStaticSerializer ()Ljava/lang/String; + public fun serializeToProtobufWithSerializerFromKType ()[B + public fun serializeToProtobufWithStaticSerializer ()[B + public fun setParamEnum (Lcom/huanshankeji/kotlinx/serialization/benchmark/DifferentDataParamEnum;)V +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/DifferentDataParamEnum : java/lang/Enum, com/huanshankeji/kotlinx/serialization/benchmark/IParamEnum { + public static final field MaxLongWrapper Lcom/huanshankeji/kotlinx/serialization/benchmark/DifferentDataParamEnum; + public static final field StringWrapper Lcom/huanshankeji/kotlinx/serialization/benchmark/DifferentDataParamEnum; + public static final field TestDataWithNothing Lcom/huanshankeji/kotlinx/serialization/benchmark/DifferentDataParamEnum; + public static final field WrapperOfString Lcom/huanshankeji/kotlinx/serialization/benchmark/DifferentDataParamEnum; + public static final field WrapperOfZeroInt Lcom/huanshankeji/kotlinx/serialization/benchmark/DifferentDataParamEnum; + public static final field WrapperOfZeroLong Lcom/huanshankeji/kotlinx/serialization/benchmark/DifferentDataParamEnum; + public static final field ZeroIntWrapper Lcom/huanshankeji/kotlinx/serialization/benchmark/DifferentDataParamEnum; + public static final field ZeroLongWrapper Lcom/huanshankeji/kotlinx/serialization/benchmark/DifferentDataParamEnum; + public fun getDataSerializationConfig ()Lcom/huanshankeji/kotlinx/serialization/benchmark/DataSerializationConfig; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static fun valueOf (Ljava/lang/String;)Lcom/huanshankeji/kotlinx/serialization/benchmark/DifferentDataParamEnum; + public static fun values ()[Lcom/huanshankeji/kotlinx/serialization/benchmark/DifferentDataParamEnum; +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/FixedLongWrapper { + public static final field Companion Lcom/huanshankeji/kotlinx/serialization/benchmark/FixedLongWrapper$Companion; + public fun (J)V + public final fun getValue ()J +} + +public synthetic class com/huanshankeji/kotlinx/serialization/benchmark/FixedLongWrapper$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/huanshankeji/kotlinx/serialization/benchmark/FixedLongWrapper$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/huanshankeji/kotlinx/serialization/benchmark/FixedLongWrapper; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/huanshankeji/kotlinx/serialization/benchmark/FixedLongWrapper;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/FixedLongWrapper$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public abstract interface class com/huanshankeji/kotlinx/serialization/benchmark/IParamEnum { + public abstract fun getDataSerializationConfig ()Lcom/huanshankeji/kotlinx/serialization/benchmark/DataSerializationConfig; +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/IntWrapper { + public static final field Companion Lcom/huanshankeji/kotlinx/serialization/benchmark/IntWrapper$Companion; + public fun (I)V + public final fun getValue ()I +} + +public synthetic class com/huanshankeji/kotlinx/serialization/benchmark/IntWrapper$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/huanshankeji/kotlinx/serialization/benchmark/IntWrapper$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/huanshankeji/kotlinx/serialization/benchmark/IntWrapper; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/huanshankeji/kotlinx/serialization/benchmark/IntWrapper;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/IntWrapper$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/LongWrapper { + public static final field Companion Lcom/huanshankeji/kotlinx/serialization/benchmark/LongWrapper$Companion; + public fun (J)V + public final fun getValue ()J +} + +public synthetic class com/huanshankeji/kotlinx/serialization/benchmark/LongWrapper$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/huanshankeji/kotlinx/serialization/benchmark/LongWrapper$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/huanshankeji/kotlinx/serialization/benchmark/LongWrapper; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/huanshankeji/kotlinx/serialization/benchmark/LongWrapper;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/LongWrapper$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/StringWrapper { + public static final field Companion Lcom/huanshankeji/kotlinx/serialization/benchmark/StringWrapper$Companion; + public fun (Ljava/lang/String;)V + public final fun getValue ()Ljava/lang/String; +} + +public synthetic class com/huanshankeji/kotlinx/serialization/benchmark/StringWrapper$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/huanshankeji/kotlinx/serialization/benchmark/StringWrapper$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/huanshankeji/kotlinx/serialization/benchmark/StringWrapper; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/huanshankeji/kotlinx/serialization/benchmark/StringWrapper;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/StringWrapper$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/TestData { + public static final field Companion Lcom/huanshankeji/kotlinx/serialization/benchmark/TestData$Companion; + public fun (Ljava/lang/String;Ljava/lang/Object;)V + public final fun getProperty1 ()Ljava/lang/String; + public final fun getProperty2 ()Ljava/lang/Object; +} + +public synthetic class com/huanshankeji/kotlinx/serialization/benchmark/TestData$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public fun (Lkotlinx/serialization/KSerializer;)V + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/huanshankeji/kotlinx/serialization/benchmark/TestData; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/huanshankeji/kotlinx/serialization/benchmark/TestData;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/TestData$Companion { + public final fun serializer (Lkotlinx/serialization/KSerializer;)Lkotlinx/serialization/KSerializer; +} + +public class com/huanshankeji/kotlinx/serialization/benchmark/TestDataBenchmark : com/huanshankeji/kotlinx/serialization/benchmark/BaseBenchmark { + public fun ()V + public fun serializeToJson ()Ljava/lang/String; + public fun serializeToJsonWithStaticSerializer ()Ljava/lang/String; + public fun serializeToProtobuf ()[B + public fun serializeToProtobufWithNothingWorkaround ()[B + public fun serializeToProtobufWithStaticSerializer ()[B +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/Wrapper { + public static final field Companion Lcom/huanshankeji/kotlinx/serialization/benchmark/Wrapper$Companion; + public fun (Ljava/lang/Object;)V + public final fun getValue ()Ljava/lang/Object; +} + +public synthetic class com/huanshankeji/kotlinx/serialization/benchmark/Wrapper$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public fun (Lkotlinx/serialization/KSerializer;)V + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/huanshankeji/kotlinx/serialization/benchmark/Wrapper; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/huanshankeji/kotlinx/serialization/benchmark/Wrapper;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/Wrapper$Companion { + public final fun serializer (Lkotlinx/serialization/KSerializer;)Lkotlinx/serialization/KSerializer; +} + +public class com/huanshankeji/kotlinx/serialization/benchmark/protobuf/ProtoBufBenchmark : com/huanshankeji/kotlinx/serialization/benchmark/BaseBenchmark { + public field paramEnum Lcom/huanshankeji/kotlinx/serialization/benchmark/protobuf/ProtoBufBenchmark$ParamEnum; + public fun ()V + public fun getParamEnum ()Lcom/huanshankeji/kotlinx/serialization/benchmark/protobuf/ProtoBufBenchmark$ParamEnum; + public fun serialize ()[B + public fun setParamEnum (Lcom/huanshankeji/kotlinx/serialization/benchmark/protobuf/ProtoBufBenchmark$ParamEnum;)V +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/protobuf/ProtoBufBenchmark$ParamEnum : java/lang/Enum, com/huanshankeji/kotlinx/serialization/benchmark/IParamEnum { + public static final field MaxDefaultLongWrapper Lcom/huanshankeji/kotlinx/serialization/benchmark/protobuf/ProtoBufBenchmark$ParamEnum; + public static final field MaxFixedLongWrapper Lcom/huanshankeji/kotlinx/serialization/benchmark/protobuf/ProtoBufBenchmark$ParamEnum; + public static final field MaxLongWrapper Lcom/huanshankeji/kotlinx/serialization/benchmark/protobuf/ProtoBufBenchmark$ParamEnum; + public static final field ZeroDefaultLongWrapper Lcom/huanshankeji/kotlinx/serialization/benchmark/protobuf/ProtoBufBenchmark$ParamEnum; + public static final field ZeroFixedLongWrapper Lcom/huanshankeji/kotlinx/serialization/benchmark/protobuf/ProtoBufBenchmark$ParamEnum; + public static final field ZeroLongWrapper Lcom/huanshankeji/kotlinx/serialization/benchmark/protobuf/ProtoBufBenchmark$ParamEnum; + public fun getDataSerializationConfig ()Lcom/huanshankeji/kotlinx/serialization/benchmark/DataSerializationConfig; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static fun valueOf (Ljava/lang/String;)Lcom/huanshankeji/kotlinx/serialization/benchmark/protobuf/ProtoBufBenchmark$ParamEnum; + public static fun values ()[Lcom/huanshankeji/kotlinx/serialization/benchmark/protobuf/ProtoBufBenchmark$ParamEnum; +} + diff --git a/serialization/benchmark/api/kotlin-common-serialization-benchmark.klib.api b/serialization/benchmark/api/kotlin-common-serialization-benchmark.klib.api new file mode 100644 index 0000000..d63a6df --- /dev/null +++ b/serialization/benchmark/api/kotlin-common-serialization-benchmark.klib.api @@ -0,0 +1,275 @@ +// Klib ABI Dump +// Targets: [js] +// Rendering settings: +// - Signature version: 2 +// - Show manifest properties: true +// - Show declarations: true + +// Library unique name: +final enum class com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum : com.huanshankeji.kotlinx.serialization.benchmark/IParamEnum, kotlin/Enum { // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum|null[0] + enum entry MaxLongWrapper // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum.MaxLongWrapper|null[0] + enum entry StringWrapper // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum.StringWrapper|null[0] + enum entry TestDataWithNothing // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum.TestDataWithNothing|null[0] + enum entry WrapperOfString // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum.WrapperOfString|null[0] + enum entry WrapperOfZeroInt // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum.WrapperOfZeroInt|null[0] + enum entry WrapperOfZeroLong // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum.WrapperOfZeroLong|null[0] + enum entry ZeroIntWrapper // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum.ZeroIntWrapper|null[0] + enum entry ZeroLongWrapper // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum.ZeroLongWrapper|null[0] + + final val dataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum.dataSerializationConfig|{}dataSerializationConfig[0] + final fun (): com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig<*> // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum.dataSerializationConfig.|(){}[0] + final val entries // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum.entries|#static{}entries[0] + final fun (): kotlin.enums/EnumEntries // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum.entries.|#static(){}[0] + + final fun valueOf(kotlin/String): com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum.valueOf|valueOf#static(kotlin.String){}[0] + final fun values(): kotlin/Array // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum.values|values#static(){}[0] +} + +abstract interface com.huanshankeji.kotlinx.serialization.benchmark/IParamEnum { // com.huanshankeji.kotlinx.serialization.benchmark/IParamEnum|null[0] + abstract val dataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark/IParamEnum.dataSerializationConfig|{}dataSerializationConfig[0] + abstract fun (): com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig<*> // com.huanshankeji.kotlinx.serialization.benchmark/IParamEnum.dataSerializationConfig.|(){}[0] +} + +abstract class com.huanshankeji.kotlinx.serialization.benchmark/BaseBenchmark { // com.huanshankeji.kotlinx.serialization.benchmark/BaseBenchmark|null[0] + constructor () // com.huanshankeji.kotlinx.serialization.benchmark/BaseBenchmark.|(){}[0] +} + +final class <#A: kotlin/Any> com.huanshankeji.kotlinx.serialization.benchmark/TestData { // com.huanshankeji.kotlinx.serialization.benchmark/TestData|null[0] + constructor (kotlin/String, #A?) // com.huanshankeji.kotlinx.serialization.benchmark/TestData.|(kotlin.String;1:0?){}[0] + + final val property1 // com.huanshankeji.kotlinx.serialization.benchmark/TestData.property1|{}property1[0] + final fun (): kotlin/String // com.huanshankeji.kotlinx.serialization.benchmark/TestData.property1.|(){}[0] + final val property2 // com.huanshankeji.kotlinx.serialization.benchmark/TestData.property2|{}property2[0] + final fun (): #A? // com.huanshankeji.kotlinx.serialization.benchmark/TestData.property2.|(){}[0] + + final class <#A1: kotlin/Any?> $serializer : kotlinx.serialization.internal/GeneratedSerializer> { // com.huanshankeji.kotlinx.serialization.benchmark/TestData.$serializer|null[0] + constructor (kotlinx.serialization/KSerializer<#A1>) // com.huanshankeji.kotlinx.serialization.benchmark/TestData.$serializer.|(kotlinx.serialization.KSerializer<1:0>){}[0] + + final val descriptor // com.huanshankeji.kotlinx.serialization.benchmark/TestData.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // com.huanshankeji.kotlinx.serialization.benchmark/TestData.$serializer.descriptor.|(){}[0] + final val typeSerial0 // com.huanshankeji.kotlinx.serialization.benchmark/TestData.$serializer.typeSerial0|{}typeSerial0[0] + + final fun childSerializers(): kotlin/Array> // com.huanshankeji.kotlinx.serialization.benchmark/TestData.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): com.huanshankeji.kotlinx.serialization.benchmark/TestData<#A1> // com.huanshankeji.kotlinx.serialization.benchmark/TestData.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, com.huanshankeji.kotlinx.serialization.benchmark/TestData<#A1>) // com.huanshankeji.kotlinx.serialization.benchmark/TestData.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;com.huanshankeji.kotlinx.serialization.benchmark.TestData<1:0>){}[0] + final fun typeParametersSerializers(): kotlin/Array> // com.huanshankeji.kotlinx.serialization.benchmark/TestData.$serializer.typeParametersSerializers|typeParametersSerializers(){}[0] + } + + final object Companion : kotlinx.serialization.internal/SerializerFactory { // com.huanshankeji.kotlinx.serialization.benchmark/TestData.Companion|null[0] + final val $cachedDescriptor // com.huanshankeji.kotlinx.serialization.benchmark/TestData.Companion.$cachedDescriptor|{}$cachedDescriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // com.huanshankeji.kotlinx.serialization.benchmark/TestData.Companion.$cachedDescriptor.|(){}[0] + + final fun <#A2: kotlin/Any?> serializer(kotlinx.serialization/KSerializer<#A2>): kotlinx.serialization/KSerializer> // com.huanshankeji.kotlinx.serialization.benchmark/TestData.Companion.serializer|serializer(kotlinx.serialization.KSerializer<0:0>){0§}[0] + final fun serializer(kotlin/Array>...): kotlinx.serialization/KSerializer<*> // com.huanshankeji.kotlinx.serialization.benchmark/TestData.Companion.serializer|serializer(kotlin.Array>...){}[0] + } +} + +final class <#A: kotlin/Any> com.huanshankeji.kotlinx.serialization.benchmark/Wrapper { // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper|null[0] + constructor (#A) // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.|(1:0){}[0] + + final val value // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.value|{}value[0] + final fun (): #A // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.value.|(){}[0] + + final class <#A1: kotlin/Any?> $serializer : kotlinx.serialization.internal/GeneratedSerializer> { // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.$serializer|null[0] + constructor (kotlinx.serialization/KSerializer<#A1>) // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.$serializer.|(kotlinx.serialization.KSerializer<1:0>){}[0] + + final val descriptor // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.$serializer.descriptor.|(){}[0] + final val typeSerial0 // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.$serializer.typeSerial0|{}typeSerial0[0] + + final fun childSerializers(): kotlin/Array> // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): com.huanshankeji.kotlinx.serialization.benchmark/Wrapper<#A1> // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, com.huanshankeji.kotlinx.serialization.benchmark/Wrapper<#A1>) // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;com.huanshankeji.kotlinx.serialization.benchmark.Wrapper<1:0>){}[0] + final fun typeParametersSerializers(): kotlin/Array> // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.$serializer.typeParametersSerializers|typeParametersSerializers(){}[0] + } + + final object Companion : kotlinx.serialization.internal/SerializerFactory { // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.Companion|null[0] + final val $cachedDescriptor // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.Companion.$cachedDescriptor|{}$cachedDescriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.Companion.$cachedDescriptor.|(){}[0] + + final fun <#A2: kotlin/Any?> serializer(kotlinx.serialization/KSerializer<#A2>): kotlinx.serialization/KSerializer> // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.Companion.serializer|serializer(kotlinx.serialization.KSerializer<0:0>){0§}[0] + final fun serializer(kotlin/Array>...): kotlinx.serialization/KSerializer<*> // com.huanshankeji.kotlinx.serialization.benchmark/Wrapper.Companion.serializer|serializer(kotlin.Array>...){}[0] + } +} + +final class <#A: kotlin/Any?> com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig { // com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig|null[0] + constructor (kotlin.reflect/KType, kotlinx.serialization/SerializationStrategy<#A>, #A) // com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig.|(kotlin.reflect.KType;kotlinx.serialization.SerializationStrategy<1:0>;1:0){}[0] + + final val data // com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig.data|{}data[0] + final fun (): #A // com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig.data.|(){}[0] + final val kType // com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig.kType|{}kType[0] + final fun (): kotlin.reflect/KType // com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig.kType.|(){}[0] + final val serializer // com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig.serializer|{}serializer[0] + final fun (): kotlinx.serialization/SerializationStrategy<#A> // com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig.serializer.|(){}[0] +} + +final class com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark : com.huanshankeji.kotlinx.serialization.benchmark/BaseBenchmark { // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark|null[0] + constructor () // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.|(){}[0] + + final var paramEnum // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.paramEnum|{}paramEnum[0] + final fun (): com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.paramEnum.|(){}[0] + final fun (com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum) // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.paramEnum.|(com.huanshankeji.kotlinx.serialization.benchmark.protobuf.ProtoBufBenchmark.ParamEnum){}[0] + + final fun serialize(): kotlin/ByteArray // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.serialize|serialize(){}[0] + + final enum class ParamEnum : com.huanshankeji.kotlinx.serialization.benchmark/IParamEnum, kotlin/Enum { // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum|null[0] + enum entry MaxDefaultLongWrapper // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum.MaxDefaultLongWrapper|null[0] + enum entry MaxFixedLongWrapper // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum.MaxFixedLongWrapper|null[0] + enum entry MaxLongWrapper // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum.MaxLongWrapper|null[0] + enum entry ZeroDefaultLongWrapper // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum.ZeroDefaultLongWrapper|null[0] + enum entry ZeroFixedLongWrapper // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum.ZeroFixedLongWrapper|null[0] + enum entry ZeroLongWrapper // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum.ZeroLongWrapper|null[0] + + final val dataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum.dataSerializationConfig|{}dataSerializationConfig[0] + final fun (): com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig<*> // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum.dataSerializationConfig.|(){}[0] + final val entries // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum.entries|#static{}entries[0] + final fun (): kotlin.enums/EnumEntries // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum.entries.|#static(){}[0] + + final fun valueOf(kotlin/String): com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum.valueOf|valueOf#static(kotlin.String){}[0] + final fun values(): kotlin/Array // com.huanshankeji.kotlinx.serialization.benchmark.protobuf/ProtoBufBenchmark.ParamEnum.values|values#static(){}[0] + } +} + +final class com.huanshankeji.kotlinx.serialization.benchmark/DefaultLongWrapper { // com.huanshankeji.kotlinx.serialization.benchmark/DefaultLongWrapper|null[0] + constructor (kotlin/Long) // com.huanshankeji.kotlinx.serialization.benchmark/DefaultLongWrapper.|(kotlin.Long){}[0] + + final val value // com.huanshankeji.kotlinx.serialization.benchmark/DefaultLongWrapper.value|{}value[0] + final fun (): kotlin/Long // com.huanshankeji.kotlinx.serialization.benchmark/DefaultLongWrapper.value.|(){}[0] + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // com.huanshankeji.kotlinx.serialization.benchmark/DefaultLongWrapper.$serializer|null[0] + final val descriptor // com.huanshankeji.kotlinx.serialization.benchmark/DefaultLongWrapper.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // com.huanshankeji.kotlinx.serialization.benchmark/DefaultLongWrapper.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // com.huanshankeji.kotlinx.serialization.benchmark/DefaultLongWrapper.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): com.huanshankeji.kotlinx.serialization.benchmark/DefaultLongWrapper // com.huanshankeji.kotlinx.serialization.benchmark/DefaultLongWrapper.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, com.huanshankeji.kotlinx.serialization.benchmark/DefaultLongWrapper) // com.huanshankeji.kotlinx.serialization.benchmark/DefaultLongWrapper.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;com.huanshankeji.kotlinx.serialization.benchmark.DefaultLongWrapper){}[0] + } + + final object Companion { // com.huanshankeji.kotlinx.serialization.benchmark/DefaultLongWrapper.Companion|null[0] + final fun serializer(): kotlinx.serialization/KSerializer // com.huanshankeji.kotlinx.serialization.benchmark/DefaultLongWrapper.Companion.serializer|serializer(){}[0] + } +} + +final class com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataBenchmark : com.huanshankeji.kotlinx.serialization.benchmark/BaseBenchmark { // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataBenchmark|null[0] + constructor () // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataBenchmark.|(){}[0] + + final var paramEnum // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataBenchmark.paramEnum|{}paramEnum[0] + final fun (): com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataBenchmark.paramEnum.|(){}[0] + final fun (com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataParamEnum) // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataBenchmark.paramEnum.|(com.huanshankeji.kotlinx.serialization.benchmark.DifferentDataParamEnum){}[0] + + final fun serializeToJsonWithSerializerFromKType(): kotlin/String // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataBenchmark.serializeToJsonWithSerializerFromKType|serializeToJsonWithSerializerFromKType(){}[0] + final fun serializeToJsonWithStaticSerializer(): kotlin/String // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataBenchmark.serializeToJsonWithStaticSerializer|serializeToJsonWithStaticSerializer(){}[0] + final fun serializeToProtobufWithSerializerFromKType(): kotlin/ByteArray // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataBenchmark.serializeToProtobufWithSerializerFromKType|serializeToProtobufWithSerializerFromKType(){}[0] + final fun serializeToProtobufWithStaticSerializer(): kotlin/ByteArray // com.huanshankeji.kotlinx.serialization.benchmark/DifferentDataBenchmark.serializeToProtobufWithStaticSerializer|serializeToProtobufWithStaticSerializer(){}[0] +} + +final class com.huanshankeji.kotlinx.serialization.benchmark/FixedLongWrapper { // com.huanshankeji.kotlinx.serialization.benchmark/FixedLongWrapper|null[0] + constructor (kotlin/Long) // com.huanshankeji.kotlinx.serialization.benchmark/FixedLongWrapper.|(kotlin.Long){}[0] + + final val value // com.huanshankeji.kotlinx.serialization.benchmark/FixedLongWrapper.value|{}value[0] + final fun (): kotlin/Long // com.huanshankeji.kotlinx.serialization.benchmark/FixedLongWrapper.value.|(){}[0] + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // com.huanshankeji.kotlinx.serialization.benchmark/FixedLongWrapper.$serializer|null[0] + final val descriptor // com.huanshankeji.kotlinx.serialization.benchmark/FixedLongWrapper.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // com.huanshankeji.kotlinx.serialization.benchmark/FixedLongWrapper.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // com.huanshankeji.kotlinx.serialization.benchmark/FixedLongWrapper.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): com.huanshankeji.kotlinx.serialization.benchmark/FixedLongWrapper // com.huanshankeji.kotlinx.serialization.benchmark/FixedLongWrapper.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, com.huanshankeji.kotlinx.serialization.benchmark/FixedLongWrapper) // com.huanshankeji.kotlinx.serialization.benchmark/FixedLongWrapper.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;com.huanshankeji.kotlinx.serialization.benchmark.FixedLongWrapper){}[0] + } + + final object Companion { // com.huanshankeji.kotlinx.serialization.benchmark/FixedLongWrapper.Companion|null[0] + final fun serializer(): kotlinx.serialization/KSerializer // com.huanshankeji.kotlinx.serialization.benchmark/FixedLongWrapper.Companion.serializer|serializer(){}[0] + } +} + +final class com.huanshankeji.kotlinx.serialization.benchmark/IntWrapper { // com.huanshankeji.kotlinx.serialization.benchmark/IntWrapper|null[0] + constructor (kotlin/Int) // com.huanshankeji.kotlinx.serialization.benchmark/IntWrapper.|(kotlin.Int){}[0] + + final val value // com.huanshankeji.kotlinx.serialization.benchmark/IntWrapper.value|{}value[0] + final fun (): kotlin/Int // com.huanshankeji.kotlinx.serialization.benchmark/IntWrapper.value.|(){}[0] + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // com.huanshankeji.kotlinx.serialization.benchmark/IntWrapper.$serializer|null[0] + final val descriptor // com.huanshankeji.kotlinx.serialization.benchmark/IntWrapper.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // com.huanshankeji.kotlinx.serialization.benchmark/IntWrapper.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // com.huanshankeji.kotlinx.serialization.benchmark/IntWrapper.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): com.huanshankeji.kotlinx.serialization.benchmark/IntWrapper // com.huanshankeji.kotlinx.serialization.benchmark/IntWrapper.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, com.huanshankeji.kotlinx.serialization.benchmark/IntWrapper) // com.huanshankeji.kotlinx.serialization.benchmark/IntWrapper.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;com.huanshankeji.kotlinx.serialization.benchmark.IntWrapper){}[0] + } + + final object Companion { // com.huanshankeji.kotlinx.serialization.benchmark/IntWrapper.Companion|null[0] + final fun serializer(): kotlinx.serialization/KSerializer // com.huanshankeji.kotlinx.serialization.benchmark/IntWrapper.Companion.serializer|serializer(){}[0] + } +} + +final class com.huanshankeji.kotlinx.serialization.benchmark/LongWrapper { // com.huanshankeji.kotlinx.serialization.benchmark/LongWrapper|null[0] + constructor (kotlin/Long) // com.huanshankeji.kotlinx.serialization.benchmark/LongWrapper.|(kotlin.Long){}[0] + + final val value // com.huanshankeji.kotlinx.serialization.benchmark/LongWrapper.value|{}value[0] + final fun (): kotlin/Long // com.huanshankeji.kotlinx.serialization.benchmark/LongWrapper.value.|(){}[0] + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // com.huanshankeji.kotlinx.serialization.benchmark/LongWrapper.$serializer|null[0] + final val descriptor // com.huanshankeji.kotlinx.serialization.benchmark/LongWrapper.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // com.huanshankeji.kotlinx.serialization.benchmark/LongWrapper.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // com.huanshankeji.kotlinx.serialization.benchmark/LongWrapper.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): com.huanshankeji.kotlinx.serialization.benchmark/LongWrapper // com.huanshankeji.kotlinx.serialization.benchmark/LongWrapper.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, com.huanshankeji.kotlinx.serialization.benchmark/LongWrapper) // com.huanshankeji.kotlinx.serialization.benchmark/LongWrapper.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;com.huanshankeji.kotlinx.serialization.benchmark.LongWrapper){}[0] + } + + final object Companion { // com.huanshankeji.kotlinx.serialization.benchmark/LongWrapper.Companion|null[0] + final fun serializer(): kotlinx.serialization/KSerializer // com.huanshankeji.kotlinx.serialization.benchmark/LongWrapper.Companion.serializer|serializer(){}[0] + } +} + +final class com.huanshankeji.kotlinx.serialization.benchmark/StringWrapper { // com.huanshankeji.kotlinx.serialization.benchmark/StringWrapper|null[0] + constructor (kotlin/String) // com.huanshankeji.kotlinx.serialization.benchmark/StringWrapper.|(kotlin.String){}[0] + + final val value // com.huanshankeji.kotlinx.serialization.benchmark/StringWrapper.value|{}value[0] + final fun (): kotlin/String // com.huanshankeji.kotlinx.serialization.benchmark/StringWrapper.value.|(){}[0] + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // com.huanshankeji.kotlinx.serialization.benchmark/StringWrapper.$serializer|null[0] + final val descriptor // com.huanshankeji.kotlinx.serialization.benchmark/StringWrapper.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // com.huanshankeji.kotlinx.serialization.benchmark/StringWrapper.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // com.huanshankeji.kotlinx.serialization.benchmark/StringWrapper.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): com.huanshankeji.kotlinx.serialization.benchmark/StringWrapper // com.huanshankeji.kotlinx.serialization.benchmark/StringWrapper.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, com.huanshankeji.kotlinx.serialization.benchmark/StringWrapper) // com.huanshankeji.kotlinx.serialization.benchmark/StringWrapper.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;com.huanshankeji.kotlinx.serialization.benchmark.StringWrapper){}[0] + } + + final object Companion { // com.huanshankeji.kotlinx.serialization.benchmark/StringWrapper.Companion|null[0] + final fun serializer(): kotlinx.serialization/KSerializer // com.huanshankeji.kotlinx.serialization.benchmark/StringWrapper.Companion.serializer|serializer(){}[0] + } +} + +final class com.huanshankeji.kotlinx.serialization.benchmark/TestDataBenchmark : com.huanshankeji.kotlinx.serialization.benchmark/BaseBenchmark { // com.huanshankeji.kotlinx.serialization.benchmark/TestDataBenchmark|null[0] + constructor () // com.huanshankeji.kotlinx.serialization.benchmark/TestDataBenchmark.|(){}[0] + + final fun serializeToJson(): kotlin/String // com.huanshankeji.kotlinx.serialization.benchmark/TestDataBenchmark.serializeToJson|serializeToJson(){}[0] + final fun serializeToJsonWithStaticSerializer(): kotlin/String // com.huanshankeji.kotlinx.serialization.benchmark/TestDataBenchmark.serializeToJsonWithStaticSerializer|serializeToJsonWithStaticSerializer(){}[0] + final fun serializeToProtobuf(): kotlin/ByteArray // com.huanshankeji.kotlinx.serialization.benchmark/TestDataBenchmark.serializeToProtobuf|serializeToProtobuf(){}[0] + final fun serializeToProtobufWithNothingWorkaround(): kotlin/ByteArray // com.huanshankeji.kotlinx.serialization.benchmark/TestDataBenchmark.serializeToProtobufWithNothingWorkaround|serializeToProtobufWithNothingWorkaround(){}[0] + final fun serializeToProtobufWithStaticSerializer(): kotlin/ByteArray // com.huanshankeji.kotlinx.serialization.benchmark/TestDataBenchmark.serializeToProtobufWithStaticSerializer|serializeToProtobufWithStaticSerializer(){}[0] +} + +final val com.huanshankeji.kotlinx.serialization.benchmark/maxDefaultLongWrapperDataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark/maxDefaultLongWrapperDataSerializationConfig|{}maxDefaultLongWrapperDataSerializationConfig[0] + final fun (): com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark/maxDefaultLongWrapperDataSerializationConfig.|(){}[0] +final val com.huanshankeji.kotlinx.serialization.benchmark/maxFixedLongWrapperDataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark/maxFixedLongWrapperDataSerializationConfig|{}maxFixedLongWrapperDataSerializationConfig[0] + final fun (): com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark/maxFixedLongWrapperDataSerializationConfig.|(){}[0] +final val com.huanshankeji.kotlinx.serialization.benchmark/maxLongWrapperDataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark/maxLongWrapperDataSerializationConfig|{}maxLongWrapperDataSerializationConfig[0] + final fun (): com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark/maxLongWrapperDataSerializationConfig.|(){}[0] +final val com.huanshankeji.kotlinx.serialization.benchmark/testDataOfNothing // com.huanshankeji.kotlinx.serialization.benchmark/testDataOfNothing|{}testDataOfNothing[0] + final fun (): com.huanshankeji.kotlinx.serialization.benchmark/TestData // com.huanshankeji.kotlinx.serialization.benchmark/testDataOfNothing.|(){}[0] +final val com.huanshankeji.kotlinx.serialization.benchmark/testDataOfNothingDataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark/testDataOfNothingDataSerializationConfig|{}testDataOfNothingDataSerializationConfig[0] + final fun (): com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig> // com.huanshankeji.kotlinx.serialization.benchmark/testDataOfNothingDataSerializationConfig.|(){}[0] +final val com.huanshankeji.kotlinx.serialization.benchmark/testDataOfNothingSerializer // com.huanshankeji.kotlinx.serialization.benchmark/testDataOfNothingSerializer|{}testDataOfNothingSerializer[0] + final fun (): kotlinx.serialization/SerializationStrategy> // com.huanshankeji.kotlinx.serialization.benchmark/testDataOfNothingSerializer.|(){}[0] +final val com.huanshankeji.kotlinx.serialization.benchmark/zeroDefaultLongWrapperDataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark/zeroDefaultLongWrapperDataSerializationConfig|{}zeroDefaultLongWrapperDataSerializationConfig[0] + final fun (): com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark/zeroDefaultLongWrapperDataSerializationConfig.|(){}[0] +final val com.huanshankeji.kotlinx.serialization.benchmark/zeroFixedLongWrapperDataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark/zeroFixedLongWrapperDataSerializationConfig|{}zeroFixedLongWrapperDataSerializationConfig[0] + final fun (): com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark/zeroFixedLongWrapperDataSerializationConfig.|(){}[0] +final val com.huanshankeji.kotlinx.serialization.benchmark/zeroLongWrapperDataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark/zeroLongWrapperDataSerializationConfig|{}zeroLongWrapperDataSerializationConfig[0] + final fun (): com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig // com.huanshankeji.kotlinx.serialization.benchmark/zeroLongWrapperDataSerializationConfig.|(){}[0] + +final inline fun <#A: reified kotlin/Any?> com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig(#A): com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig<#A> // com.huanshankeji.kotlinx.serialization.benchmark/DataSerializationConfig|DataSerializationConfig(0:0){0§}[0] diff --git a/serialization/benchmark/jvm-only/api/kotlin-common-serialization-benchmark-jvm-only.api b/serialization/benchmark/jvm-only/api/kotlin-common-serialization-benchmark-jvm-only.api new file mode 100644 index 0000000..236fcc4 --- /dev/null +++ b/serialization/benchmark/jvm-only/api/kotlin-common-serialization-benchmark-jvm-only.api @@ -0,0 +1,16 @@ +public abstract class com/huanshankeji/kotlinx/serialization/benchmark/GoogleProtobufBaseBenchmark : com/huanshankeji/kotlinx/serialization/benchmark/BaseBenchmark { + public field paramEnum Lcom/huanshankeji/kotlinx/serialization/benchmark/GoogleProtobufBaseBenchmark$ParamEnum; + public fun ()V + public fun getParamEnum ()Lcom/huanshankeji/kotlinx/serialization/benchmark/GoogleProtobufBaseBenchmark$ParamEnum; + public fun setParamEnum (Lcom/huanshankeji/kotlinx/serialization/benchmark/GoogleProtobufBaseBenchmark$ParamEnum;)V +} + +public final class com/huanshankeji/kotlinx/serialization/benchmark/GoogleProtobufBaseBenchmark$ParamEnum : java/lang/Enum { + public static final field Max Lcom/huanshankeji/kotlinx/serialization/benchmark/GoogleProtobufBaseBenchmark$ParamEnum; + public static final field Zero Lcom/huanshankeji/kotlinx/serialization/benchmark/GoogleProtobufBaseBenchmark$ParamEnum; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public final fun getLongWrapper ()Lcom/huanshankeji/kotlinx/serialization/benchmark/LongWrapper; + public static fun valueOf (Ljava/lang/String;)Lcom/huanshankeji/kotlinx/serialization/benchmark/GoogleProtobufBaseBenchmark$ParamEnum; + public static fun values ()[Lcom/huanshankeji/kotlinx/serialization/benchmark/GoogleProtobufBaseBenchmark$ParamEnum; +} + diff --git a/settings.gradle.kts b/settings.gradle.kts index 8cb783c..1b9f161 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -15,6 +15,10 @@ include( "serialization:benchmark:jvm-only", "vertx", "vertx:with-context-receivers", + /* + "vertx:kotlinx-io", + "vertx:okio", + */ ) fun ProjectDescriptor.setProjectConcatenatedNames(prefix: String) { @@ -24,7 +28,7 @@ fun ProjectDescriptor.setProjectConcatenatedNames(prefix: String) { } rootProject.setProjectConcatenatedNames("") -// This is needed for Kotlin Native. +// This is needed for Kotlin Native and Dokka. dependencyResolutionManagement { @Suppress("UnstableApiUsage") repositories { diff --git a/vertx/api/kotlin-common-vertx.api b/vertx/api/kotlin-common-vertx.api new file mode 100644 index 0000000..682d7e6 --- /dev/null +++ b/vertx/api/kotlin-common-vertx.api @@ -0,0 +1,302 @@ +public final class com/huanshankeji/vertx/NativeTransportKt { + public static final fun isNativeTransportEnabled (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public final class com/huanshankeji/vertx/WebKt { + public static final fun failWithBadRequest (Lio/vertx/ext/web/RoutingContext;)V + public static final fun failWithBadRequest (Lio/vertx/ext/web/RoutingContext;Ljava/lang/Throwable;)V + public static final fun failWithForbidden (Lio/vertx/ext/web/RoutingContext;)V + public static final fun failWithUnauthorized (Lio/vertx/ext/web/RoutingContext;)V +} + +public final class com/huanshankeji/vertx/core/BufferKt { + public static final fun wrappedBuffer ([B)Lio/vertx/core/buffer/Buffer; +} + +public class com/huanshankeji/vertx/core/CombinedVerticle : io/vertx/core/AbstractVerticle, com/huanshankeji/vertx/core/CombinedVerticleFunctions { + public fun (Ljava/util/List;)V + public fun getSubVerticles ()Ljava/util/List; + public fun init (Lio/vertx/core/Vertx;Lio/vertx/core/Context;)V + public fun runAllWithPromise (Ljava/util/List;Lkotlin/jvm/functions/Function2;Lio/vertx/core/Promise;)V + public fun start (Lio/vertx/core/Promise;)V + public fun stop (Lio/vertx/core/Promise;)V + public fun subVerticlesInit (Lio/vertx/core/Vertx;Lio/vertx/core/Context;)V + public fun subVerticlesStart (Lio/vertx/core/Promise;)V + public fun subVerticlesStartUnit (Lio/vertx/core/Promise;)V + public fun subVerticlesStop (Lio/vertx/core/Promise;)V + public fun subVerticlesStopUnit (Lio/vertx/core/Promise;)V +} + +public abstract interface class com/huanshankeji/vertx/core/CombinedVerticleFunctions : io/vertx/core/Verticle { + public abstract fun getSubVerticles ()Ljava/util/List; + public abstract fun runAllWithPromise (Ljava/util/List;Lkotlin/jvm/functions/Function2;Lio/vertx/core/Promise;)V + public abstract fun subVerticlesInit (Lio/vertx/core/Vertx;Lio/vertx/core/Context;)V + public abstract fun subVerticlesStart (Lio/vertx/core/Promise;)V + public abstract fun subVerticlesStartUnit (Lio/vertx/core/Promise;)V + public abstract fun subVerticlesStop (Lio/vertx/core/Promise;)V + public abstract fun subVerticlesStopUnit (Lio/vertx/core/Promise;)V +} + +public final class com/huanshankeji/vertx/core/CombinedVerticleFunctions$DefaultImpls { + public static fun runAllWithPromise (Lcom/huanshankeji/vertx/core/CombinedVerticleFunctions;Ljava/util/List;Lkotlin/jvm/functions/Function2;Lio/vertx/core/Promise;)V + public static fun subVerticlesInit (Lcom/huanshankeji/vertx/core/CombinedVerticleFunctions;Lio/vertx/core/Vertx;Lio/vertx/core/Context;)V + public static fun subVerticlesStart (Lcom/huanshankeji/vertx/core/CombinedVerticleFunctions;Lio/vertx/core/Promise;)V + public static fun subVerticlesStartUnit (Lcom/huanshankeji/vertx/core/CombinedVerticleFunctions;Lio/vertx/core/Promise;)V + public static fun subVerticlesStop (Lcom/huanshankeji/vertx/core/CombinedVerticleFunctions;Lio/vertx/core/Promise;)V + public static fun subVerticlesStopUnit (Lcom/huanshankeji/vertx/core/CombinedVerticleFunctions;Lio/vertx/core/Promise;)V +} + +public final class com/huanshankeji/vertx/core/HandlerKt { + public static final fun plus (Lio/vertx/core/Handler;Lio/vertx/core/Handler;)Lio/vertx/core/Handler; +} + +public final class com/huanshankeji/vertx/core/VertxKt { + public static final fun deployVerticleOnAllCores (Lio/vertx/core/Vertx;Ljava/util/function/Supplier;)Lio/vertx/core/Future; +} + +public final class com/huanshankeji/vertx/core/kotlinx/io/VertxBufferRawSink : kotlinx/io/RawSink { + public static final synthetic fun box-impl (Lio/vertx/core/buffer/Buffer;)Lcom/huanshankeji/vertx/core/kotlinx/io/VertxBufferRawSink; + public fun close ()V + public static fun close-impl (Lio/vertx/core/buffer/Buffer;)V + public static fun constructor-impl (Lio/vertx/core/buffer/Buffer;)Lio/vertx/core/buffer/Buffer; + public fun equals (Ljava/lang/Object;)Z + public static fun equals-impl (Lio/vertx/core/buffer/Buffer;Ljava/lang/Object;)Z + public static final fun equals-impl0 (Lio/vertx/core/buffer/Buffer;Lio/vertx/core/buffer/Buffer;)Z + public fun flush ()V + public static fun flush-impl (Lio/vertx/core/buffer/Buffer;)V + public final fun getVertxBuffer ()Lio/vertx/core/buffer/Buffer; + public fun hashCode ()I + public static fun hashCode-impl (Lio/vertx/core/buffer/Buffer;)I + public fun toString ()Ljava/lang/String; + public static fun toString-impl (Lio/vertx/core/buffer/Buffer;)Ljava/lang/String; + public final synthetic fun unbox-impl ()Lio/vertx/core/buffer/Buffer; + public fun write (Lkotlinx/io/Buffer;J)V + public static fun write-impl (Lio/vertx/core/buffer/Buffer;Lkotlinx/io/Buffer;J)V +} + +public final class com/huanshankeji/vertx/core/kotlinx/io/VertxBufferRawSinkKt { + public static final fun toRawSink (Lio/vertx/core/buffer/Buffer;)Lkotlinx/io/RawSink; + public static final fun toSink (Lio/vertx/core/buffer/Buffer;)Lkotlinx/io/Sink; +} + +public final class com/huanshankeji/vertx/core/kotlinx/io/VertxBufferWriteStreamRawSink : kotlinx/io/RawSink { + public static final synthetic fun box-impl (Lio/vertx/core/streams/WriteStream;)Lcom/huanshankeji/vertx/core/kotlinx/io/VertxBufferWriteStreamRawSink; + public fun close ()V + public static fun close-impl (Lio/vertx/core/streams/WriteStream;)V + public static fun constructor-impl (Lio/vertx/core/streams/WriteStream;)Lio/vertx/core/streams/WriteStream; + public fun equals (Ljava/lang/Object;)Z + public static fun equals-impl (Lio/vertx/core/streams/WriteStream;Ljava/lang/Object;)Z + public static final fun equals-impl0 (Lio/vertx/core/streams/WriteStream;Lio/vertx/core/streams/WriteStream;)Z + public fun flush ()V + public static fun flush-impl (Lio/vertx/core/streams/WriteStream;)V + public final fun getWriteStream ()Lio/vertx/core/streams/WriteStream; + public fun hashCode ()I + public static fun hashCode-impl (Lio/vertx/core/streams/WriteStream;)I + public fun toString ()Ljava/lang/String; + public static fun toString-impl (Lio/vertx/core/streams/WriteStream;)Ljava/lang/String; + public final synthetic fun unbox-impl ()Lio/vertx/core/streams/WriteStream; + public fun write (Lkotlinx/io/Buffer;J)V + public static fun write-impl (Lio/vertx/core/streams/WriteStream;Lkotlinx/io/Buffer;J)V +} + +public final class com/huanshankeji/vertx/core/kotlinx/io/VertxBufferWriteStreamRawSinkKt { + public static final fun toRawSink (Lio/vertx/core/streams/WriteStream;)Lkotlinx/io/RawSink; + public static final fun toSink (Lio/vertx/core/streams/WriteStream;)Lkotlinx/io/Sink; +} + +public final class com/huanshankeji/vertx/core/okio/VertxBufferSink : okio/Sink { + public static final synthetic fun box-impl (Lio/vertx/core/buffer/Buffer;)Lcom/huanshankeji/vertx/core/okio/VertxBufferSink; + public fun close ()V + public static fun close-impl (Lio/vertx/core/buffer/Buffer;)V + public static fun constructor-impl (Lio/vertx/core/buffer/Buffer;)Lio/vertx/core/buffer/Buffer; + public fun equals (Ljava/lang/Object;)Z + public static fun equals-impl (Lio/vertx/core/buffer/Buffer;Ljava/lang/Object;)Z + public static final fun equals-impl0 (Lio/vertx/core/buffer/Buffer;Lio/vertx/core/buffer/Buffer;)Z + public fun flush ()V + public static fun flush-impl (Lio/vertx/core/buffer/Buffer;)V + public final fun getVertxBuffer ()Lio/vertx/core/buffer/Buffer; + public fun hashCode ()I + public static fun hashCode-impl (Lio/vertx/core/buffer/Buffer;)I + public fun timeout ()Lokio/Timeout; + public static fun timeout-impl (Lio/vertx/core/buffer/Buffer;)Lokio/Timeout; + public fun toString ()Ljava/lang/String; + public static fun toString-impl (Lio/vertx/core/buffer/Buffer;)Ljava/lang/String; + public final synthetic fun unbox-impl ()Lio/vertx/core/buffer/Buffer; + public fun write (Lokio/Buffer;J)V + public static fun write-impl (Lio/vertx/core/buffer/Buffer;Lokio/Buffer;J)V +} + +public final class com/huanshankeji/vertx/core/okio/VertxBufferSinkKt { + public static final fun toBufferedSink (Lio/vertx/core/buffer/Buffer;)Lokio/BufferedSink; + public static final fun toSink (Lio/vertx/core/buffer/Buffer;)Lokio/Sink; +} + +public final class com/huanshankeji/vertx/core/okio/VertxBufferWriteStreamSink : okio/Sink { + public static final synthetic fun box-impl (Lio/vertx/core/streams/WriteStream;)Lcom/huanshankeji/vertx/core/okio/VertxBufferWriteStreamSink; + public fun close ()V + public static fun close-impl (Lio/vertx/core/streams/WriteStream;)V + public static fun constructor-impl (Lio/vertx/core/streams/WriteStream;)Lio/vertx/core/streams/WriteStream; + public fun equals (Ljava/lang/Object;)Z + public static fun equals-impl (Lio/vertx/core/streams/WriteStream;Ljava/lang/Object;)Z + public static final fun equals-impl0 (Lio/vertx/core/streams/WriteStream;Lio/vertx/core/streams/WriteStream;)Z + public fun flush ()V + public static fun flush-impl (Lio/vertx/core/streams/WriteStream;)V + public final fun getWriteStream ()Lio/vertx/core/streams/WriteStream; + public fun hashCode ()I + public static fun hashCode-impl (Lio/vertx/core/streams/WriteStream;)I + public fun timeout ()Lokio/Timeout; + public static fun timeout-impl (Lio/vertx/core/streams/WriteStream;)Lokio/Timeout; + public fun toString ()Ljava/lang/String; + public static fun toString-impl (Lio/vertx/core/streams/WriteStream;)Ljava/lang/String; + public final synthetic fun unbox-impl ()Lio/vertx/core/streams/WriteStream; + public fun write (Lokio/Buffer;J)V + public static fun write-impl (Lio/vertx/core/streams/WriteStream;Lokio/Buffer;J)V +} + +public final class com/huanshankeji/vertx/core/okio/VertxBufferWriteStreamSinkKt { + public static final fun toBufferedSink (Lio/vertx/core/streams/WriteStream;)Lokio/Sink; + public static final fun toSink (Lio/vertx/core/streams/WriteStream;)Lokio/Sink; +} + +public final class com/huanshankeji/vertx/ext/web/RoutingContextKt { + public static final fun checkedRun (Lio/vertx/ext/web/RoutingContext;Lkotlin/jvm/functions/Function0;)V +} + +public abstract interface class com/huanshankeji/vertx/ext/web/SingleVirtualHostVerticle : com/huanshankeji/vertx/ext/web/VirtualHostCombinable, io/vertx/core/Verticle { + public abstract fun getVirtualHost ()Ljava/lang/String; + public abstract fun routesOnVirtualHost (Lio/vertx/ext/web/Router;)V + public abstract fun subRouter ()Lio/vertx/ext/web/Router; + public abstract fun virtualHostSubRouter (Lio/vertx/ext/web/Router;)V +} + +public final class com/huanshankeji/vertx/ext/web/SingleVirtualHostVerticle$DefaultImpls { + public static fun routesOnVirtualHost (Lcom/huanshankeji/vertx/ext/web/SingleVirtualHostVerticle;Lio/vertx/ext/web/Router;)V + public static fun subRouter (Lcom/huanshankeji/vertx/ext/web/SingleVirtualHostVerticle;)Lio/vertx/ext/web/Router; +} + +public abstract interface class com/huanshankeji/vertx/ext/web/VirtualHostCombinable { + public abstract fun routesOnVirtualHost (Lio/vertx/ext/web/Router;)V +} + +public abstract interface class com/huanshankeji/vertx/kotlin/coroutines/CoroutineCombinedVerticleFunctions : com/huanshankeji/vertx/core/CombinedVerticleFunctions { + public abstract fun subVerticlesStart (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun subVerticlesStop (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun toPromise (Lio/vertx/core/Handler;)Lio/vertx/core/Promise; +} + +public final class com/huanshankeji/vertx/kotlin/coroutines/CoroutineCombinedVerticleFunctions$DefaultImpls { + public static fun runAllWithPromise (Lcom/huanshankeji/vertx/kotlin/coroutines/CoroutineCombinedVerticleFunctions;Ljava/util/List;Lkotlin/jvm/functions/Function2;Lio/vertx/core/Promise;)V + public static fun subVerticlesInit (Lcom/huanshankeji/vertx/kotlin/coroutines/CoroutineCombinedVerticleFunctions;Lio/vertx/core/Vertx;Lio/vertx/core/Context;)V + public static fun subVerticlesStart (Lcom/huanshankeji/vertx/kotlin/coroutines/CoroutineCombinedVerticleFunctions;Lio/vertx/core/Promise;)V + public static fun subVerticlesStart (Lcom/huanshankeji/vertx/kotlin/coroutines/CoroutineCombinedVerticleFunctions;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun subVerticlesStartUnit (Lcom/huanshankeji/vertx/kotlin/coroutines/CoroutineCombinedVerticleFunctions;Lio/vertx/core/Promise;)V + public static fun subVerticlesStop (Lcom/huanshankeji/vertx/kotlin/coroutines/CoroutineCombinedVerticleFunctions;Lio/vertx/core/Promise;)V + public static fun subVerticlesStop (Lcom/huanshankeji/vertx/kotlin/coroutines/CoroutineCombinedVerticleFunctions;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun subVerticlesStopUnit (Lcom/huanshankeji/vertx/kotlin/coroutines/CoroutineCombinedVerticleFunctions;Lio/vertx/core/Promise;)V + public static fun toPromise (Lcom/huanshankeji/vertx/kotlin/coroutines/CoroutineCombinedVerticleFunctions;Lio/vertx/core/Handler;)Lio/vertx/core/Promise; +} + +public abstract interface class com/huanshankeji/vertx/kotlin/coroutines/CoroutineVerticleI : io/vertx/core/Verticle, kotlinx/coroutines/CoroutineScope { + public abstract fun start (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun stop (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public final class com/huanshankeji/vertx/kotlin/coroutines/CoroutineVerticleI$DefaultImpls { + public static fun start (Lcom/huanshankeji/vertx/kotlin/coroutines/CoroutineVerticleI;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun stop (Lcom/huanshankeji/vertx/kotlin/coroutines/CoroutineVerticleI;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public final class com/huanshankeji/vertx/kotlin/coroutines/VertxCoroutineKt { + public static final fun awaitAll (Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun awaitExecuteBlocking (Lio/vertx/core/Vertx;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun awaitSuspendExecuteBlocking (Lio/vertx/core/Vertx;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun coroutineToFuture (Lkotlinx/coroutines/CoroutineScope;Lkotlin/coroutines/CoroutineContext;Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function2;)Lio/vertx/core/Future; + public static synthetic fun coroutineToFuture$default (Lkotlinx/coroutines/CoroutineScope;Lkotlin/coroutines/CoroutineContext;Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lio/vertx/core/Future; + public static final fun use (Lio/vertx/core/Vertx;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public final class com/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode : java/lang/Enum { + public static final field DefaultOnVertxEventLoop Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode; + public static final field Unconfined Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static fun valueOf (Ljava/lang/String;)Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode; + public static fun values ()[Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode; +} + +public final class com/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlersKt { + public static final fun checkedCoroutineHandler (Lio/vertx/ext/web/Route;Lkotlinx/coroutines/CoroutineScope;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;)Lio/vertx/ext/web/Route; + public static final fun checkedCoroutineHandler (Lkotlinx/coroutines/CoroutineScope;Lio/vertx/ext/web/Route;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;)Lio/vertx/ext/web/Route; + public static synthetic fun checkedCoroutineHandler$default (Lio/vertx/ext/web/Route;Lkotlinx/coroutines/CoroutineScope;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lio/vertx/ext/web/Route; + public static synthetic fun checkedCoroutineHandler$default (Lkotlinx/coroutines/CoroutineScope;Lio/vertx/ext/web/Route;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lio/vertx/ext/web/Route; + public static final fun coroutineHandler (Lio/vertx/ext/web/Route;Lkotlinx/coroutines/CoroutineScope;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;)Lio/vertx/ext/web/Route; + public static final fun coroutineHandler (Lio/vertx/ext/web/Route;Lkotlinx/coroutines/CoroutineScope;Lkotlin/coroutines/CoroutineContext;Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function2;)Lio/vertx/ext/web/Route; + public static final fun coroutineHandler (Lkotlinx/coroutines/CoroutineScope;Lio/vertx/ext/web/Route;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;)Lio/vertx/ext/web/Route; + public static synthetic fun coroutineHandler$default (Lio/vertx/ext/web/Route;Lkotlinx/coroutines/CoroutineScope;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lio/vertx/ext/web/Route; + public static synthetic fun coroutineHandler$default (Lkotlinx/coroutines/CoroutineScope;Lio/vertx/ext/web/Route;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lio/vertx/ext/web/Route; +} + +public abstract class com/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticle : io/vertx/kotlin/coroutines/CoroutineVerticle, com/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticleI { + public fun ()V + public fun checkedCoroutineHandler (Lio/vertx/ext/web/Route;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;)Lio/vertx/ext/web/Route; + public final fun checkedCoroutineHandlerInline (Lio/vertx/ext/web/Route;Lkotlin/jvm/functions/Function2;)Lio/vertx/ext/web/Route; + public fun coroutineHandler (Lio/vertx/ext/web/Route;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;)Lio/vertx/ext/web/Route; + public final fun coroutineHandlerInline (Lio/vertx/ext/web/Route;Lkotlin/jvm/functions/Function2;)Lio/vertx/ext/web/Route; + public fun start (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun stop (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public abstract interface class com/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticleI : com/huanshankeji/vertx/kotlin/coroutines/CoroutineVerticleI { + public abstract fun checkedCoroutineHandler (Lio/vertx/ext/web/Route;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;)Lio/vertx/ext/web/Route; + public abstract fun coroutineHandler (Lio/vertx/ext/web/Route;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;)Lio/vertx/ext/web/Route; +} + +public final class com/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticleI$DefaultImpls { + public static fun checkedCoroutineHandler (Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticleI;Lio/vertx/ext/web/Route;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;)Lio/vertx/ext/web/Route; + public static synthetic fun checkedCoroutineHandler$default (Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticleI;Lio/vertx/ext/web/Route;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lio/vertx/ext/web/Route; + public static fun coroutineHandler (Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticleI;Lio/vertx/ext/web/Route;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;)Lio/vertx/ext/web/Route; + public static synthetic fun coroutineHandler$default (Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticleI;Lio/vertx/ext/web/Route;Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlerLaunchMode;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lio/vertx/ext/web/Route; + public static fun start (Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticleI;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun stop (Lcom/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticleI;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public final class com/huanshankeji/vertx/kotlin/coroutines/ext/web/RoutingContextKt { + public static final fun launchChecked (Lkotlinx/coroutines/CoroutineScope;Lio/vertx/ext/web/RoutingContext;Lkotlin/coroutines/CoroutineContext;Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/Job; + public static synthetic fun launchChecked$default (Lkotlinx/coroutines/CoroutineScope;Lio/vertx/ext/web/RoutingContext;Lkotlin/coroutines/CoroutineContext;Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/Job; +} + +public final class com/huanshankeji/vertx/kotlin/ext/web/RoutingContextKt { + public static final fun set (Lio/vertx/ext/web/RoutingContext;Ljava/lang/String;Ljava/lang/Object;)V +} + +public final class com/huanshankeji/vertx/kotlin/sqlclient/BatchSqlResultSequencesKt { + public static final fun batchSqlResultRowCountSequence (Lio/vertx/sqlclient/SqlResult;)Lkotlin/sequences/Sequence; + public static final fun batchSqlResultRowSequenceSequence (Lio/vertx/sqlclient/RowSet;)Lkotlin/sequences/Sequence; + public static final fun batchSqlResultSequence (Lio/vertx/sqlclient/SqlResult;)Lkotlin/sequences/Sequence; +} + +public final class com/huanshankeji/vertx/kotlin/sqlclient/PreparedQueryKt { + public static final fun executeBatchAwaitForSqlResultSequence (Lio/vertx/sqlclient/PreparedQuery;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public final class com/huanshankeji/vertx/pgclient/PgPoolOptionsKt { + public static final fun setUpConventionally (Lio/vertx/pgclient/impl/PgPoolOptions;)V +} + +public final class com/huanshankeji/vertx/sqlclient/ClientBuilderKt { + public static final fun withCoConnectHandler (Lio/vertx/sqlclient/ClientBuilder;Lkotlin/jvm/functions/Function2;)Lio/vertx/sqlclient/ClientBuilder; +} + +public final class com/huanshankeji/vertx/sqlclient/PreparedQueryBatchExecutionKt { + public static final fun sortDataAndExecuteBatch (Lio/vertx/sqlclient/PreparedQuery;Ljava/util/List;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Lio/vertx/core/Future; + public static final fun sortTuplesAndExecuteBatch (Lio/vertx/sqlclient/PreparedQuery;Ljava/util/List;Ljava/util/List;)Lio/vertx/core/Future; + public static final fun sortTuplesAndExecuteBatch (Lio/vertx/sqlclient/PreparedQuery;Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lio/vertx/core/Future; +} + +public final class com/huanshankeji/vertx/sqlclient/SqlConnectOptionsKt { + public static final fun setUpConventionally (Lio/vertx/sqlclient/SqlConnectOptions;)V +} + +public final class com/huanshankeji/vertx/sqlclient/TupleKt { + public static final fun toList (Lio/vertx/sqlclient/Tuple;)Ljava/util/List; +} + diff --git a/vertx/build.gradle.kts b/vertx/build.gradle.kts index b10093d..d25a584 100644 --- a/vertx/build.gradle.kts +++ b/vertx/build.gradle.kts @@ -11,6 +11,15 @@ java { registerFeature("vertxSqlClient") { usingSourceSet(sourceSets["main"]) } + registerFeature("vertxPgClient") { + usingSourceSet(sourceSets["main"]) + } + registerFeature("kotlinxIo") { + usingSourceSet(sourceSets["main"]) + } + registerFeature("okio") { + usingSourceSet(sourceSets["main"]) + } } dependencies { @@ -19,10 +28,14 @@ dependencies { implementation(moduleWithoutVersion("core")) "vertxWebImplementation"(moduleWithoutVersion("web")) "vertxSqlClientImplementation"(moduleWithoutVersion("sql-client")) + "vertxPgClientImplementation"(moduleWithoutVersion("pg-client")) implementation(moduleWithoutVersion("lang-kotlin")) implementation(moduleWithoutVersion("lang-kotlin-coroutines")) } + "kotlinxIoImplementation"("org.jetbrains.kotlinx:kotlinx-io-core:${DependencyVersions.kotlinxIo}") + "okioImplementation"("com.squareup.okio:okio:${DependencyVersions.okio}") + implementation(cpnProject(project, ":core")) implementation(cpnProject(project, ":coroutines")) diff --git a/vertx/src/main/kotlin/com/huanshankeji/vertx/core/Buffer.kt b/vertx/src/main/kotlin/com/huanshankeji/vertx/core/Buffer.kt index 4733581..00f9b18 100644 --- a/vertx/src/main/kotlin/com/huanshankeji/vertx/core/Buffer.kt +++ b/vertx/src/main/kotlin/com/huanshankeji/vertx/core/Buffer.kt @@ -2,10 +2,11 @@ package com.huanshankeji.vertx.core import io.netty.buffer.Unpooled import io.vertx.core.buffer.Buffer +import io.vertx.core.buffer.impl.BufferImpl /** * Creates a wrapped [Buffer] so that unnecessary copy is avoided. * Also see https://github.com/eclipse-vertx/vert.x/issues/4407. */ fun wrappedBuffer(byteArray: ByteArray): Buffer = - Buffer.buffer(Unpooled.wrappedBuffer(byteArray)) + BufferImpl.buffer(Unpooled.wrappedBuffer(byteArray)) diff --git a/vertx/src/main/kotlin/com/huanshankeji/vertx/core/Handler.kt b/vertx/src/main/kotlin/com/huanshankeji/vertx/core/Handler.kt new file mode 100644 index 0000000..c10da11 --- /dev/null +++ b/vertx/src/main/kotlin/com/huanshankeji/vertx/core/Handler.kt @@ -0,0 +1,20 @@ +package com.huanshankeji.vertx.core + +import com.huanshankeji.ExperimentalApi +import io.vertx.core.Handler + +typealias NullableHandler = Handler? + +@Suppress("NOTHING_TO_INLINE") +@ExperimentalApi +inline operator fun NullableHandler.plus(other: NullableHandler): NullableHandler = + if (this === null) + other + else if (other === null) + this + else { + Handler { + this@plus.handle(it) + other.handle(it) + } + } diff --git a/vertx/src/main/kotlin/com/huanshankeji/vertx/core/kotlinx/io/Primitives.kt b/vertx/src/main/kotlin/com/huanshankeji/vertx/core/kotlinx/io/Primitives.kt new file mode 100644 index 0000000..6b03528 --- /dev/null +++ b/vertx/src/main/kotlin/com/huanshankeji/vertx/core/kotlinx/io/Primitives.kt @@ -0,0 +1,7 @@ +package com.huanshankeji.vertx.core.kotlinx.io + +@Suppress("NOTHING_TO_INLINE") +internal inline fun Long.toIntOrThrow(): Int { + require(this in Int.MIN_VALUE.toLong()..Int.MAX_VALUE.toLong()) + return toInt() +} diff --git a/vertx/src/main/kotlin/com/huanshankeji/vertx/core/kotlinx/io/VertxBufferRawSink.kt b/vertx/src/main/kotlin/com/huanshankeji/vertx/core/kotlinx/io/VertxBufferRawSink.kt new file mode 100644 index 0000000..617ee85 --- /dev/null +++ b/vertx/src/main/kotlin/com/huanshankeji/vertx/core/kotlinx/io/VertxBufferRawSink.kt @@ -0,0 +1,25 @@ +package com.huanshankeji.vertx.core.kotlinx.io + +import kotlinx.io.RawSink +import kotlinx.io.Sink +import kotlinx.io.buffered +import kotlinx.io.readByteArray +import io.vertx.core.buffer.Buffer as VertxBuffer +import kotlinx.io.Buffer as KotlinxIoBuffer + +@JvmInline +value class VertxBufferRawSink(val vertxBuffer: VertxBuffer) : RawSink { + override fun write(source: KotlinxIoBuffer, byteCount: Long) { + vertxBuffer.appendBytes(source.readByteArray(byteCount.toIntOrThrow())) + } + + override fun flush() {} + + override fun close() {} +} + +fun VertxBuffer.toRawSink(): RawSink = + VertxBufferRawSink(this) + +fun VertxBuffer.toSink(): Sink = + toRawSink().buffered() diff --git a/vertx/src/main/kotlin/com/huanshankeji/vertx/core/kotlinx/io/VertxBufferWriteStreamRawSink.kt b/vertx/src/main/kotlin/com/huanshankeji/vertx/core/kotlinx/io/VertxBufferWriteStreamRawSink.kt new file mode 100644 index 0000000..2e42231 --- /dev/null +++ b/vertx/src/main/kotlin/com/huanshankeji/vertx/core/kotlinx/io/VertxBufferWriteStreamRawSink.kt @@ -0,0 +1,30 @@ +package com.huanshankeji.vertx.core.kotlinx.io + +import io.vertx.core.buffer.Buffer +import io.vertx.core.streams.WriteStream +import io.vertx.kotlin.coroutines.coAwait +import kotlinx.coroutines.runBlocking +import kotlinx.io.RawSink +import kotlinx.io.buffered +import kotlinx.io.readByteArray + +@JvmInline +value class VertxBufferWriteStreamRawSink(val writeStream: WriteStream) : RawSink { + override fun write(source: kotlinx.io.Buffer, byteCount: Long) { + runBlocking { + writeStream.write(Buffer.buffer(source.readByteArray(byteCount.toIntOrThrow()))).coAwait() + } + } + + override fun flush() {} + + override fun close() { + writeStream.end() + } +} + +fun WriteStream.toRawSink(): RawSink = + VertxBufferWriteStreamRawSink(this) + +fun WriteStream.toSink() = + toRawSink().buffered() diff --git a/vertx/src/main/kotlin/com/huanshankeji/vertx/core/okio/VertxBufferSink.kt b/vertx/src/main/kotlin/com/huanshankeji/vertx/core/okio/VertxBufferSink.kt new file mode 100644 index 0000000..8dd69e6 --- /dev/null +++ b/vertx/src/main/kotlin/com/huanshankeji/vertx/core/okio/VertxBufferSink.kt @@ -0,0 +1,27 @@ +package com.huanshankeji.vertx.core.okio + +import okio.Buffer +import okio.Sink +import okio.Timeout +import okio.buffer +import io.vertx.core.buffer.Buffer as VertxBuffer + +@JvmInline +value class VertxBufferSink(val vertxBuffer: VertxBuffer) : Sink { + override fun write(source: Buffer, byteCount: Long) { + vertxBuffer.appendBytes(source.readByteArray(byteCount)) + } + + override fun flush() {} + + override fun timeout(): Timeout = + Timeout.NONE //timeout + + override fun close() {} +} + +fun VertxBuffer.toSink(): Sink = + VertxBufferSink(this) + +fun VertxBuffer.toBufferedSink() = + toSink().buffer() diff --git a/vertx/src/main/kotlin/com/huanshankeji/vertx/core/okio/VertxBufferWriteStreamSink.kt b/vertx/src/main/kotlin/com/huanshankeji/vertx/core/okio/VertxBufferWriteStreamSink.kt new file mode 100644 index 0000000..fffac8d --- /dev/null +++ b/vertx/src/main/kotlin/com/huanshankeji/vertx/core/okio/VertxBufferWriteStreamSink.kt @@ -0,0 +1,34 @@ +package com.huanshankeji.vertx.core.okio + +import io.vertx.core.buffer.Buffer +import io.vertx.core.streams.WriteStream +import io.vertx.kotlin.coroutines.coAwait +import kotlinx.coroutines.runBlocking +import okio.Sink +import okio.Timeout +import okio.buffer + +@JvmInline +value class VertxBufferWriteStreamSink(val writeStream: WriteStream) : Sink { + override fun write(source: okio.Buffer, byteCount: Long) { + runBlocking { + writeStream.write(Buffer.buffer(source.readByteArray(byteCount))).coAwait() + } + } + + override fun flush() {} + + //private val timeout = Timeout() + override fun timeout(): Timeout = + Timeout.NONE //timeout + + override fun close() { + writeStream.end() + } +} + +fun WriteStream.toSink(): Sink = + VertxBufferWriteStreamSink(this) + +fun WriteStream.toBufferedSink(): Sink = + toSink().buffer() diff --git a/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/coroutines/VertxCoroutine.kt b/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/coroutines/VertxCoroutine.kt index 43fba0d..2b74489 100644 --- a/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/coroutines/VertxCoroutine.kt +++ b/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/coroutines/VertxCoroutine.kt @@ -5,7 +5,7 @@ import io.vertx.core.Future import io.vertx.core.Handler import io.vertx.core.Promise import io.vertx.core.Vertx -import io.vertx.kotlin.coroutines.await +import io.vertx.kotlin.coroutines.coAwait import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineStart import kotlinx.coroutines.coroutineScope @@ -18,8 +18,7 @@ import kotlin.coroutines.EmptyCoroutineContext * Execute the [block] code and close the [Vertx] instance like [kotlin.use] on an [AutoCloseable]. */ suspend inline fun Vertx.use(block: (Vertx) -> R): R = - @Suppress("MoveLambdaOutsideParentheses") - use(block, { close().await() }) + use(block) { close().coAwait() } /** * Execute [blockingCode] that returns the a [T] instance with [Vertx.executeBlocking] @@ -31,7 +30,7 @@ suspend inline fun Vertx.use(block: (Vertx) -> R): R = suspend fun Vertx.awaitExecuteBlocking(blockingCode: () -> T): T = executeBlocking(Callable { blockingCode() - }).await() + }).coAwait() // TODO: this should probably be removed /** @@ -43,7 +42,7 @@ suspend fun Vertx.awaitSuspendExecuteBlocking(blockingCode: suspend () -> T) coroutineScope { executeBlocking(Handler> { launch { it.complete(blockingCode()) } - }).await() + }).coAwait() } /** @@ -73,4 +72,4 @@ fun CoroutineScope.coroutineToFuture( * @see kotlinx.coroutines.awaitAll */ suspend fun List>.awaitAll(): List = - Future.all(this).await().list() + Future.all(this).coAwait().list() diff --git a/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlers.kt b/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlers.kt index 8114448..e8a34d0 100644 --- a/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlers.kt +++ b/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlers.kt @@ -5,11 +5,22 @@ import com.huanshankeji.vertx.kotlin.coroutines.ext.web.CoroutineHandlerLaunchMo import com.huanshankeji.vertx.kotlin.coroutines.ext.web.CoroutineHandlerLaunchMode.Unconfined import io.vertx.ext.web.Route import io.vertx.ext.web.RoutingContext +import io.vertx.kotlin.coroutines.CoroutineRouterSupport import io.vertx.kotlin.coroutines.CoroutineVerticle +import io.vertx.kotlin.coroutines.coroutineRouter import kotlinx.coroutines.* import kotlin.coroutines.CoroutineContext import kotlin.coroutines.EmptyCoroutineContext +/** + * This function can be replaced by [coroutineRouter] and [CoroutineRouterSupport.coHandler] + * which is newly introduced to the official "vertx-lang-kotlin-coroutines" library. + * However, note that [CoroutineRouterSupport.coHandler] handles exceptions and is equivalent to [Route.checkedCoroutineHandler]. + * See the [official docs](https://vertx.io/docs/vertx-lang-kotlin-coroutines/kotlin/#_vert_x_web) for more details. + * + * This function is not deprecated yet and can still serve its purpose in some scenarios + * because the approach above is still a bit ugly for the lack of [context parameters](https://github.com/Kotlin/KEEP/issues/367). + */ fun Route.coroutineHandler( coroutineScope: CoroutineScope, context: CoroutineContext, start: CoroutineStart, @@ -73,6 +84,9 @@ fun coroutineHandler( ): Route = route.coroutineHandler(coroutineScope, launchMode, requestHandler) +/** + * @see coroutineHandler + */ // workaround for context receivers fun Route.checkedCoroutineHandler( coroutineScope: CoroutineScope, diff --git a/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticle.kt b/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticle.kt index ecfa171..abea665 100644 --- a/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticle.kt +++ b/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticle.kt @@ -16,7 +16,7 @@ interface ExtendedWebCoroutineVerticleI : CoroutineVerticleI { launchMode: CoroutineHandlerLaunchMode = DefaultOnVertxEventLoop, requestHandler: suspend (RoutingContext) -> Unit ): Route = - coroutineHandler(this@ExtendedWebCoroutineVerticleI, this, launchMode, requestHandler) + coroutineHandler(this@ExtendedWebCoroutineVerticleI, launchMode, requestHandler) /** * Like [coroutineHandler] and calls [RoutingContext.fail] if a [Throwable] is thrown in [requestHandler]. @@ -25,7 +25,7 @@ interface ExtendedWebCoroutineVerticleI : CoroutineVerticleI { launchMode: CoroutineHandlerLaunchMode = DefaultOnVertxEventLoop, requestHandler: suspend (RoutingContext) -> Unit ): Route = - checkedCoroutineHandler(this@ExtendedWebCoroutineVerticleI, this, launchMode, requestHandler) + checkedCoroutineHandler(this@ExtendedWebCoroutineVerticleI, launchMode, requestHandler) } abstract class ExtendedWebCoroutineVerticle : CoroutineVerticle(), ExtendedWebCoroutineVerticleI { diff --git a/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/sqlclient/PreparedQuery.kt b/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/sqlclient/PreparedQuery.kt index 8494f72..c2fb485 100644 --- a/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/sqlclient/PreparedQuery.kt +++ b/vertx/src/main/kotlin/com/huanshankeji/vertx/kotlin/sqlclient/PreparedQuery.kt @@ -1,9 +1,9 @@ package com.huanshankeji.vertx.kotlin.sqlclient -import io.vertx.kotlin.coroutines.await +import io.vertx.kotlin.coroutines.coAwait import io.vertx.sqlclient.PreparedQuery import io.vertx.sqlclient.SqlResult import io.vertx.sqlclient.Tuple suspend fun > PreparedQuery.executeBatchAwaitForSqlResultSequence(batch: List) = - executeBatch(batch).await().batchSqlResultSequence() + executeBatch(batch).coAwait().batchSqlResultSequence() diff --git a/vertx/src/main/kotlin/com/huanshankeji/vertx/pgclient/PgPoolOptions.kt b/vertx/src/main/kotlin/com/huanshankeji/vertx/pgclient/PgPoolOptions.kt new file mode 100644 index 0000000..31975a9 --- /dev/null +++ b/vertx/src/main/kotlin/com/huanshankeji/vertx/pgclient/PgPoolOptions.kt @@ -0,0 +1,10 @@ +package com.huanshankeji.vertx.pgclient + +import io.vertx.pgclient.impl.PgPoolOptions + +/** + * Optimized for throughput. + */ +fun PgPoolOptions.setUpConventionally() { + isPipelined = true +} diff --git a/vertx/src/main/kotlin/com/huanshankeji/vertx/sqlclient/ClientBuilder.kt b/vertx/src/main/kotlin/com/huanshankeji/vertx/sqlclient/ClientBuilder.kt new file mode 100644 index 0000000..807bfc3 --- /dev/null +++ b/vertx/src/main/kotlin/com/huanshankeji/vertx/sqlclient/ClientBuilder.kt @@ -0,0 +1,23 @@ +package com.huanshankeji.vertx.sqlclient + +import io.vertx.kotlin.coroutines.coAwait +import io.vertx.sqlclient.ClientBuilder +import io.vertx.sqlclient.Pool +import io.vertx.sqlclient.SqlConnection +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch + +/** + * A coroutine variant of [ClientBuilder.withConnectHandler]. + * With this function, you don't need to call [SqlConnection.close] in [handler]. + */ +fun ClientBuilder<*>.withCoConnectHandler(handler: suspend (SqlConnection) -> Unit) = + withConnectHandler { + CoroutineScope(Dispatchers.Unconfined).launch { + // TODO What happens when there are exceptions in `handler`? Are they correctly propagated? + handler(it) + /** @see Pool.connectHandler */ + it.close().coAwait() + } + } diff --git a/vertx/src/main/kotlin/com/huanshankeji/vertx/sqlclient/SqlConnectOptions.kt b/vertx/src/main/kotlin/com/huanshankeji/vertx/sqlclient/SqlConnectOptions.kt new file mode 100644 index 0000000..3c07f06 --- /dev/null +++ b/vertx/src/main/kotlin/com/huanshankeji/vertx/sqlclient/SqlConnectOptions.kt @@ -0,0 +1,10 @@ +package com.huanshankeji.vertx.sqlclient + +import io.vertx.sqlclient.SqlConnectOptions + +/** + * Optimized for throughput. + */ +fun SqlConnectOptions.setUpConventionally() { + cachePreparedStatements = true +} diff --git a/vertx/src/test/kotlin/com/huanshankeji/vertx/ext/web/RoutingContextBaseTest.kt b/vertx/src/test/kotlin/com/huanshankeji/vertx/ext/web/RoutingContextBaseTest.kt index 2896542..54200a2 100644 --- a/vertx/src/test/kotlin/com/huanshankeji/vertx/ext/web/RoutingContextBaseTest.kt +++ b/vertx/src/test/kotlin/com/huanshankeji/vertx/ext/web/RoutingContextBaseTest.kt @@ -7,7 +7,7 @@ import io.vertx.ext.web.Router import io.vertx.ext.web.RoutingContext import io.vertx.ext.web.client.WebClient import io.vertx.junit5.VertxTestContext -import io.vertx.kotlin.coroutines.await +import io.vertx.kotlin.coroutines.coAwait import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -33,13 +33,13 @@ abstract class RoutingContextBaseTest : VertxBaseTest() { it.next() } - }).listen(0).await() + }).listen(0).coAwait() httpServer.use({ val port = httpServer.actualPort() WebClient.create(vertx).use({ - assertEquals(500, it.get(port, LOCALHOST, "").send().await().statusCode()) + assertEquals(500, it.get(port, LOCALHOST, "").send().coAwait().statusCode()) }, { close() }) - }, { close().await() }) + }, { close().coAwait() }) } } \ No newline at end of file diff --git a/vertx/src/test/kotlin/com/huanshankeji/vertx/kotlin/coroutines/VertxCoroutineTest.kt b/vertx/src/test/kotlin/com/huanshankeji/vertx/kotlin/coroutines/VertxCoroutineTest.kt index c04bdad..618516c 100644 --- a/vertx/src/test/kotlin/com/huanshankeji/vertx/kotlin/coroutines/VertxCoroutineTest.kt +++ b/vertx/src/test/kotlin/com/huanshankeji/vertx/kotlin/coroutines/VertxCoroutineTest.kt @@ -7,7 +7,7 @@ import io.vertx.core.AbstractVerticle import io.vertx.core.Promise import io.vertx.core.Vertx import io.vertx.core.impl.NoStackTraceThrowable -import io.vertx.kotlin.coroutines.await +import io.vertx.kotlin.coroutines.coAwait import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import kotlinx.coroutines.delay @@ -26,7 +26,7 @@ class VertxCoroutineTest : VertxBaseTest() { suspend fun assertClosed(vertx: Vertx) = assertThrows { - vertx.deployVerticle(DummyVerticle()).await() + vertx.deployVerticle(DummyVerticle()).coAwait() } @Test @@ -34,7 +34,7 @@ class VertxCoroutineTest : VertxBaseTest() { val vertx = Vertx.vertx() vertx.use { assertDoesNotThrow { - vertx.deployVerticle(DummyVerticle()).await() + vertx.deployVerticle(DummyVerticle()).coAwait() } } assertClosed(vertx) @@ -82,14 +82,14 @@ class VertxCoroutineTest : VertxBaseTest() { assertTrue(measureVirtualTime { coroutineToFuture { delay(DEFAULT_SLEEP_OR_DELAY_DURATION) - }.await() + }.coAwait() } >= DEFAULT_SLEEP_OR_DELAY_DURATION) assertTrue(measureTimeMillis { coroutineToFuture { @Suppress("BlockingMethodInNonBlockingContext") Thread.sleep(DEFAULT_SLEEP_OR_DELAY_DURATION) - }.await() + }.coAwait() } >= DEFAULT_SLEEP_OR_DELAY_DURATION) } diff --git a/vertx/src/test/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlersTest.kt b/vertx/src/test/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlersTest.kt index a96cd36..16148d1 100644 --- a/vertx/src/test/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlersTest.kt +++ b/vertx/src/test/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlersTest.kt @@ -6,7 +6,7 @@ import com.huanshankeji.vertx.kotlin.coroutines.ext.web.CoroutineHandlerLaunchMo import com.huanshankeji.vertx.kotlin.coroutines.ext.web.CoroutineHandlerLaunchMode.Unconfined import io.vertx.ext.web.Router import io.vertx.ext.web.client.WebClient -import io.vertx.kotlin.coroutines.await +import io.vertx.kotlin.coroutines.coAwait import io.vertx.kotlin.coroutines.dispatcher import io.vertx.kotlin.ext.web.client.webClientOptionsOf import kotlinx.coroutines.delay @@ -32,23 +32,23 @@ class CoroutineHandlersTest : VertxBaseTest() { fun isOnDefaultExecutor() = Thread.currentThread().name.contains("kotlinx.coroutines.DefaultExecutor") - coroutineHandler(this@withContext, get(DEFAULT_PATH), DefaultOnVertxEventLoop) { + get(DEFAULT_PATH).coroutineHandler(this@withContext, DefaultOnVertxEventLoop) { assertTrue(isOnVertxEventLoop()) delay(1) assertTrue(isOnVertxEventLoop()) it.response().end() } - coroutineHandler(this@withContext, get(UNCONFINED_PATH), Unconfined) { + get(UNCONFINED_PATH).coroutineHandler(this@withContext, Unconfined) { assertTrue(isOnVertxEventLoop()) delay(1) assertTrue(isOnDefaultExecutor()) it.response().end() } - }).listen(0).await() + }).listen(0).coAwait() WebClient.create(vertx, webClientOptionsOf(defaultPort = httpServer.actualPort())).use({ webClient -> - webClient.get(DEFAULT_PATH).send().await() - webClient.get(UNCONFINED_PATH).send().await() + webClient.get(DEFAULT_PATH).send().coAwait() + webClient.get(UNCONFINED_PATH).send().coAwait() }, { close() }) } } diff --git a/vertx/src/test/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticleTest.kt b/vertx/src/test/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticleTest.kt index a6f8ca7..26957f9 100644 --- a/vertx/src/test/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticleTest.kt +++ b/vertx/src/test/kotlin/com/huanshankeji/vertx/kotlin/coroutines/ext/web/ExtendedWebCoroutineVerticleTest.kt @@ -6,7 +6,7 @@ import io.vertx.core.http.HttpServer import io.vertx.ext.web.Router import io.vertx.ext.web.RoutingContext import io.vertx.ext.web.client.WebClient -import io.vertx.kotlin.coroutines.await +import io.vertx.kotlin.coroutines.coAwait import io.vertx.kotlin.ext.web.client.webClientOptionsOf import kotlinx.coroutines.test.runTest import kotlin.test.Test @@ -41,27 +41,27 @@ class ExtendedWebCoroutineVerticleTest : VertxBaseTest() { get("/$checkedCoroutineHandlerInline").checkedCoroutineHandlerInline(requestHandler = handler) } }) - .listen(0).await() + .listen(0).coAwait() } override suspend fun stop() { - httpServer.close().await() + httpServer.close().coAwait() } } @Test fun `test ExtendedCoroutineVerticle`() = runTest { val verticle = Verticle() - val deploymentId = vertx.deployVerticle(verticle).await() + val deploymentId = vertx.deployVerticle(verticle).coAwait() WebClient.create(vertx, webClientOptionsOf(defaultPort = verticle.httpServer.actualPort())).use({ webClient -> suspend fun testOk(methodName: String) { - assertEquals(200, webClient.get("/$methodName").send().await().statusCode()) + assertEquals(200, webClient.get("/$methodName").send().coAwait().statusCode()) } suspend fun testThrowable(methodName: String) { testOk(methodName) - assertEquals(500, webClient.get("/$methodName?throws=true").send().await().statusCode()) + assertEquals(500, webClient.get("/$methodName?throws=true").send().coAwait().statusCode()) } with(MemberFunctionNames) { @@ -71,6 +71,6 @@ class ExtendedWebCoroutineVerticleTest : VertxBaseTest() { } }, { close() }) - vertx.undeploy(deploymentId).await() + vertx.undeploy(deploymentId).coAwait() } } \ No newline at end of file diff --git a/vertx/with-context-receivers/api/kotlin-common-vertx-with-context-receivers.api b/vertx/with-context-receivers/api/kotlin-common-vertx-with-context-receivers.api new file mode 100644 index 0000000..41c7734 --- /dev/null +++ b/vertx/with-context-receivers/api/kotlin-common-vertx-with-context-receivers.api @@ -0,0 +1,5 @@ +public final class com/huanshankeji/vertx/kotlin/coroutines/ext/web/CoroutineHandlersKt { + public static final fun checkedCoroutineHandler (Lkotlinx/coroutines/CoroutineScope;Lio/vertx/ext/web/Route;Lkotlin/jvm/functions/Function2;)Lio/vertx/ext/web/Route; + public static final fun coroutineHandler (Lkotlinx/coroutines/CoroutineScope;Lio/vertx/ext/web/Route;Lkotlin/jvm/functions/Function2;)Lio/vertx/ext/web/Route; +} + diff --git a/web/api/kotlin-common-web.api b/web/api/kotlin-common-web.api new file mode 100644 index 0000000..5e2a3fe --- /dev/null +++ b/web/api/kotlin-common-web.api @@ -0,0 +1,23 @@ +public final class com/huanshankeji/web/ConstantsKt { + public static final field DEFAULT_HTTPS_PORT I + public static final field DEFAULT_HTTP_PORT I +} + +public final class com/huanshankeji/web/cors/ConstantsKt { + public static final field CACHE_PREFLIGHT_MAX_AGE I +} + +public final class com/huanshankeji/web/cors/OriginKt { + public static final fun origin (ZLjava/lang/String;Ljava/lang/Integer;)Ljava/lang/String; +} + +public final class com/huanshankeji/web/cors/PatternsKt { + public static final field CORS_LOCALHOST_ALL_PORTS_ALLOWED_ORIGIN_PATTERN Ljava/lang/String; + public static final fun corsAllowedOriginPattern (ZLjava/lang/String;Ljava/lang/Integer;)Ljava/lang/String; + public static synthetic fun corsAllowedOriginPattern$default (ZLjava/lang/String;Ljava/lang/Integer;ILjava/lang/Object;)Ljava/lang/String; +} + +public final class com/huanshankeji/web/test/ConstantsKt { + public static final field HTTP_TEST_PORT I +} + diff --git a/web/api/kotlin-common-web.klib.api b/web/api/kotlin-common-web.klib.api new file mode 100644 index 0000000..fb1fa3c --- /dev/null +++ b/web/api/kotlin-common-web.klib.api @@ -0,0 +1,21 @@ +// Klib ABI Dump +// Targets: [iosArm64, iosSimulatorArm64, iosX64, js, wasmJs] +// Rendering settings: +// - Signature version: 2 +// - Show manifest properties: true +// - Show declarations: true + +// Library unique name: +final const val com.huanshankeji.web.cors/CACHE_PREFLIGHT_MAX_AGE // com.huanshankeji.web.cors/CACHE_PREFLIGHT_MAX_AGE|{}CACHE_PREFLIGHT_MAX_AGE[0] + final fun (): kotlin/Int // com.huanshankeji.web.cors/CACHE_PREFLIGHT_MAX_AGE.|(){}[0] +final const val com.huanshankeji.web.cors/CORS_LOCALHOST_ALL_PORTS_ALLOWED_ORIGIN_PATTERN // com.huanshankeji.web.cors/CORS_LOCALHOST_ALL_PORTS_ALLOWED_ORIGIN_PATTERN|{}CORS_LOCALHOST_ALL_PORTS_ALLOWED_ORIGIN_PATTERN[0] + final fun (): kotlin/String // com.huanshankeji.web.cors/CORS_LOCALHOST_ALL_PORTS_ALLOWED_ORIGIN_PATTERN.|(){}[0] +final const val com.huanshankeji.web.test/HTTP_TEST_PORT // com.huanshankeji.web.test/HTTP_TEST_PORT|{}HTTP_TEST_PORT[0] + final fun (): kotlin/Int // com.huanshankeji.web.test/HTTP_TEST_PORT.|(){}[0] +final const val com.huanshankeji.web/DEFAULT_HTTPS_PORT // com.huanshankeji.web/DEFAULT_HTTPS_PORT|{}DEFAULT_HTTPS_PORT[0] + final fun (): kotlin/Int // com.huanshankeji.web/DEFAULT_HTTPS_PORT.|(){}[0] +final const val com.huanshankeji.web/DEFAULT_HTTP_PORT // com.huanshankeji.web/DEFAULT_HTTP_PORT|{}DEFAULT_HTTP_PORT[0] + final fun (): kotlin/Int // com.huanshankeji.web/DEFAULT_HTTP_PORT.|(){}[0] + +final fun com.huanshankeji.web.cors/corsAllowedOriginPattern(kotlin/Boolean, kotlin/String, kotlin/Int? = ...): kotlin/String // com.huanshankeji.web.cors/corsAllowedOriginPattern|corsAllowedOriginPattern(kotlin.Boolean;kotlin.String;kotlin.Int?){}[0] +final fun com.huanshankeji.web.cors/origin(kotlin/Boolean, kotlin/String, kotlin/Int?): kotlin/String // com.huanshankeji.web.cors/origin|origin(kotlin.Boolean;kotlin.String;kotlin.Int?){}[0]