Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Making factory functions of companion objects static on Java #617

Open
26 tasks
LVMVRQUXL opened this issue Mar 26, 2024 · 1 comment
Open
26 tasks

✨ Making factory functions of companion objects static on Java #617

LVMVRQUXL opened this issue Mar 26, 2024 · 1 comment
Labels
feature New feature or request. jvm Item related to the Kotlin/JVM platform.

Comments

@LVMVRQUXL
Copy link
Contributor

LVMVRQUXL commented Mar 26, 2024

📝 Description

Like suggested by @lbunschoten in #335 (comment), we want to mark the factory functions of companion objects with the JvmStatic annotation for making them statically available on Java.

Here are examples of calling the NotBlankString.create(Any?) function from Java code:

val value = "Kotools Types is awesome!"

// Actual
NotBlankString.Companion.create(value); // passes
NotBlankString.create(value); // compilation error

// Expected
NotBlankString.Companion.create(value); // passes
NotBlankString.create(value); // passes

✅ Checklist

  • Mark the NotBlankString.Companion.create(Any?) function, test its new API for Java and dump the Application Binary Interface (ABI).
  • Mark the NotBlankString.Companion.createOrNull(Any?) function, test its new API for Java and dump the ABI.
  • Mark the NonZeroInt.Companion.create(Number) function, test its new API for Java and dump the ABI.
  • Mark the NonZeroInt.Companion.createOrNull(Number) function, test its new API for Java and dump the ABI.
  • Mark the PositiveInt.Companion.create(Number) function, test its new API for Java and dump the ABI.
  • Mark the PositiveInt.Companion.createOrNull(Number) function, test its new API for Java and dump the ABI.
  • Mark the NegativeInt.Companion.create(Number) function, test its new API for Java and dump the ABI.
  • Mark the NegativeInt.Companion.createOrNull(Number) function, test its new API for Java and dump the ABI.
  • Mark the StrictlyPositiveInt.Companion.create(Number) function, test its new API for Java and dump the ABI.
  • Mark the StrictlyPositiveInt.Companion.createOrNull(Number) function, test its new API for Java and dump the ABI.
  • Mark the StrictlyNegativeInt.Companion.create(Number) function, test its new API for Java and dump the ABI.
  • Mark the StrictlyNegativeInt.Companion.createOrNull(Number) function, test its new API for Java and dump the ABI.
  • Mark the StrictlyPositiveDouble.Companion.create(Number) function, test its new API for Java and dump the ABI.
  • Mark the StrictlyPositiveDouble.Companion.createOrNull(Number) function, test its new API for Java and dump the ABI.
  • Mark the StrictlyNegativeDouble.Companion.create(Number) function, test its new API for Java and dump the ABI.
  • Mark the StrictlyNegativeDouble.Companion.createOrNull(Number) function, test its new API for Java and dump the ABI.
  • Mark the NotEmptyList.Companion.create(Collection) function, test its new API for Java and dump the ABI.
  • Mark the NotEmptyList.Companion.createOrNull(Collection) function, test its new API for Java and dump the ABI.
  • Mark the NotEmptyList.Companion.of(E, vararg E) function, test its new API for Java and dump the ABI.
  • Mark the NotEmptySet.Companion.create(Collection) function, test its new API for Java and dump the ABI.
  • Mark the NotEmptySet.Companion.createOrNull(Collection) function, test its new API for Java and dump the ABI.
  • Mark the NotEmptySet.Companion.of(E, vararg E) function, test its new API for Java and dump the ABI.
  • Mark the NotEmptyMap.Companion.create(Map) function, test its new API for Java and dump the ABI.
  • Mark the NotEmptyMap.Companion.createOrNull(Map) function, test its new API for Java and dump the ABI.
  • Mark the NotEmptyMap.Companion.of(Pair, vararg Pair) function, test its new API for Java and dump the ABI.
  • Add an entry for this issue in the unreleased changelog.
@LVMVRQUXL LVMVRQUXL added feature New feature or request. jvm Item related to the Kotlin/JVM platform. labels Mar 26, 2024
@LVMVRQUXL LVMVRQUXL added this to the 4.6.0 milestone Mar 26, 2024
@LVMVRQUXL
Copy link
Contributor Author

The factory functions of the EmailAddress type will be deprecated by #623.

@LVMVRQUXL LVMVRQUXL removed this from the 4.6.0 milestone Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request. jvm Item related to the Kotlin/JVM platform.
Projects
None yet
Development

No branches or pull requests

1 participant