From e5bc9e186e6e9bae6302ba301ad0914f3e62fbf4 Mon Sep 17 00:00:00 2001 From: Snabeldier <79211348+Snabeldier@users.noreply.github.com> Date: Mon, 6 Jan 2025 17:56:34 +0100 Subject: [PATCH] switch to usage of url instead of string --- src/main/java/minevalley/core/api/Core.java | 3 ++- src/main/java/minevalley/core/api/CoreServer.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/minevalley/core/api/Core.java b/src/main/java/minevalley/core/api/Core.java index 2b8d752..ed03a06 100644 --- a/src/main/java/minevalley/core/api/Core.java +++ b/src/main/java/minevalley/core/api/Core.java @@ -63,6 +63,7 @@ import javax.annotation.Nonnegative; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import java.net.URL; import java.sql.SQLException; import java.text.SimpleDateFormat; import java.time.DayOfWeek; @@ -1179,7 +1180,7 @@ public static Reminder createReminder(@Nonnegative int hours, @Nonnegative int m * @throws IllegalArgumentException if the URL is null */ @Nonnull - public static Webhook createWebhook(@Nonnull String url) throws IllegalArgumentException { + public static Webhook createWebhook(@Nonnull URL url) throws IllegalArgumentException { return server.createWebhook(url); } diff --git a/src/main/java/minevalley/core/api/CoreServer.java b/src/main/java/minevalley/core/api/CoreServer.java index 4b6eb23..03635a0 100644 --- a/src/main/java/minevalley/core/api/CoreServer.java +++ b/src/main/java/minevalley/core/api/CoreServer.java @@ -58,6 +58,7 @@ import javax.annotation.Nonnegative; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import java.net.URL; import java.sql.SQLException; import java.time.DayOfWeek; import java.util.List; @@ -261,7 +262,7 @@ public interface CoreServer { Reminder createReminder(int hours, int minutes, @Nonnull Runnable callback, List weekdays) throws IllegalArgumentException; @Nonnull - Webhook createWebhook(@Nonnull String url) throws IllegalArgumentException; + Webhook createWebhook(@Nonnull URL url) throws IllegalArgumentException; @Nonnull EmbeddedMessage createEmbeddedMessage();