#914: Make use of ApiStatus.Internal reather than deprecation

By: Doc <nachito94@msn.com>
This commit is contained in:
Bukkit/Spigot
2023-10-13 20:33:28 +11:00
parent 8552281a2f
commit 943fb1db3d
4 changed files with 13 additions and 9 deletions

View File

@@ -4,6 +4,7 @@ import com.google.common.base.Preconditions;
import java.util.Locale;
import java.util.UUID;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -76,9 +77,9 @@ public final class NamespacedKey {
*
* @param namespace namespace
* @param key key
* @deprecated should never be used by plugins, for internal use only!!
* @apiNote should never be used by plugins, for internal use only!!
*/
@Deprecated
@ApiStatus.Internal
public NamespacedKey(@NotNull String namespace, @NotNull String key) {
Preconditions.checkArgument(namespace != null && isValidNamespace(namespace), "Invalid namespace. Must be [a-z0-9._-]: %s", namespace);
Preconditions.checkArgument(key != null && isValidKey(key), "Invalid key. Must be [a-z0-9/._-]: %s", key);
@@ -158,7 +159,7 @@ public final class NamespacedKey {
* @return new key
* @deprecated should never be used by plugins, for internal use only!!
*/
@Deprecated
@ApiStatus.Internal
@NotNull
public static NamespacedKey randomKey() {
return new NamespacedKey(BUKKIT, UUID.randomUUID().toString());