From 9b041eb42dfc597ce6dc3a67500d52087fb9e85f Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Sat, 18 Feb 2023 11:26:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=BE=D0=B9=20=D1=80=D0=B5=D1=84=D0=B0=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../telegram/domain/keyboard/button/ContactButton.java | 7 +++++-- .../telegram/domain/keyboard/button/UrlButton.java | 7 +++++-- .../telegram/domain/keyboard/button/WebAppButton.java | 6 ++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/telegram-domain/telegram-domain-main/src/main/java/dev/struchkov/godfather/telegram/domain/keyboard/button/ContactButton.java b/telegram-domain/telegram-domain-main/src/main/java/dev/struchkov/godfather/telegram/domain/keyboard/button/ContactButton.java index 1527e5c..73d3594 100644 --- a/telegram-domain/telegram-domain-main/src/main/java/dev/struchkov/godfather/telegram/domain/keyboard/button/ContactButton.java +++ b/telegram-domain/telegram-domain-main/src/main/java/dev/struchkov/godfather/telegram/domain/keyboard/button/ContactButton.java @@ -1,7 +1,9 @@ package dev.struchkov.godfather.telegram.domain.keyboard.button; import dev.struchkov.godfather.main.domain.keyboard.KeyBoardButton; -import org.jetbrains.annotations.NotNull; + +import static dev.struchkov.haiti.utils.Inspector.Utils.nullPointer; +import static dev.struchkov.haiti.utils.Inspector.isNotNull; /** * Запрашивает у пользователя его контактный номер. @@ -16,7 +18,8 @@ public class ContactButton implements KeyBoardButton { this.label = label; } - public static ContactButton contactButton(@NotNull String label) { + public static ContactButton contactButton(String label) { + isNotNull(label, nullPointer("label")); return new ContactButton(label); } diff --git a/telegram-domain/telegram-domain-main/src/main/java/dev/struchkov/godfather/telegram/domain/keyboard/button/UrlButton.java b/telegram-domain/telegram-domain-main/src/main/java/dev/struchkov/godfather/telegram/domain/keyboard/button/UrlButton.java index ae001de..fafdab4 100644 --- a/telegram-domain/telegram-domain-main/src/main/java/dev/struchkov/godfather/telegram/domain/keyboard/button/UrlButton.java +++ b/telegram-domain/telegram-domain-main/src/main/java/dev/struchkov/godfather/telegram/domain/keyboard/button/UrlButton.java @@ -1,7 +1,8 @@ package dev.struchkov.godfather.telegram.domain.keyboard.button; import dev.struchkov.godfather.main.domain.keyboard.KeyBoardButton; -import org.jetbrains.annotations.NotNull; + +import static dev.struchkov.haiti.utils.Inspector.isNotNull; public class UrlButton implements KeyBoardButton { @@ -15,7 +16,8 @@ public class UrlButton implements KeyBoardButton { this.url = url; } - public static UrlButton urlButton(@NotNull String label, @NotNull String url) { + public static UrlButton urlButton(String label, String url) { + isNotNull(label, url); return new UrlButton(label, url); } @@ -31,4 +33,5 @@ public class UrlButton implements KeyBoardButton { public String getUrl() { return url; } + } diff --git a/telegram-domain/telegram-domain-main/src/main/java/dev/struchkov/godfather/telegram/domain/keyboard/button/WebAppButton.java b/telegram-domain/telegram-domain-main/src/main/java/dev/struchkov/godfather/telegram/domain/keyboard/button/WebAppButton.java index 64c9279..78e9404 100644 --- a/telegram-domain/telegram-domain-main/src/main/java/dev/struchkov/godfather/telegram/domain/keyboard/button/WebAppButton.java +++ b/telegram-domain/telegram-domain-main/src/main/java/dev/struchkov/godfather/telegram/domain/keyboard/button/WebAppButton.java @@ -1,7 +1,8 @@ package dev.struchkov.godfather.telegram.domain.keyboard.button; import dev.struchkov.godfather.main.domain.keyboard.KeyBoardButton; -import org.jetbrains.annotations.NotNull; + +import static dev.struchkov.haiti.utils.Inspector.isNotNull; public class WebAppButton implements KeyBoardButton { @@ -15,7 +16,8 @@ public class WebAppButton implements KeyBoardButton { this.url = url; } - public static WebAppButton webAppButton(@NotNull String label, @NotNull String url) { + public static WebAppButton webAppButton(String label, String url) { + isNotNull(label, url); return new WebAppButton(label, url); }