Небольшой рефаакторинг

This commit is contained in:
Struchkov Mark 2023-02-18 11:26:15 +03:00
parent 66ce848308
commit 9b041eb42d
Signed by: upagge
GPG Key ID: D3018BE7BA428CA6
3 changed files with 14 additions and 6 deletions

View File

@ -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);
}

View File

@ -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;
}
}

View File

@ -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);
}