Небольшой рефаакторинг
This commit is contained in:
parent
66ce848308
commit
9b041eb42d
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user