Удалил реализации клавиатур

This commit is contained in:
Struchkov Mark 2023-04-06 20:22:15 +03:00
parent 366712cfca
commit aa32c3b715
Signed by: upagge
GPG Key ID: D3018BE7BA428CA6
2 changed files with 0 additions and 105 deletions

View File

@ -1,67 +0,0 @@
package dev.struchkov.godfather.main.domain.keyboard.button;
import dev.struchkov.godfather.main.domain.keyboard.KeyBoardButton;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.Objects;
import static dev.struchkov.haiti.utils.Inspector.Utils.nullPointer;
import static dev.struchkov.haiti.utils.Inspector.isNotNull;
/**
* Абстрактная сущность кнопки для клавиатуры.
*
* @author upagge [08/07/2019]
*/
@Getter
@Setter
@NoArgsConstructor
public class SimpleButton implements KeyBoardButton {
public static final String TYPE = "SIMPLE";
/**
* Надпись на кнопке.
*/
protected String label;
/**
* Данные, которые возвращаются при нажатии.
*/
protected String callbackData;
protected SimpleButton(String label, String callbackData) {
this.label = label;
this.callbackData = callbackData;
}
public static SimpleButton simpleButton(String label, String callbackData) {
isNotNull(label, nullPointer("label"));
return new SimpleButton(label, callbackData);
}
public static SimpleButton simpleButton(String label) {
isNotNull(label, nullPointer("label"));
return new SimpleButton(label, null);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SimpleButton that = (SimpleButton) o;
return Objects.equals(label, that.label) && Objects.equals(callbackData, that.callbackData);
}
@Override
public int hashCode() {
return Objects.hash(label, callbackData);
}
@Override
public String getType() {
return TYPE;
}
}

View File

@ -1,38 +0,0 @@
package dev.struchkov.godfather.main.domain.keyboard.simple;
import dev.struchkov.godfather.main.domain.keyboard.KeyBoardButton;
import dev.struchkov.godfather.main.domain.keyboard.KeyBoardLine;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.Singular;
import java.util.Arrays;
import java.util.List;
/**
* Строка в меню клавиатуры {@link dev.struchkov.godfather.main.domain.keyboard.KeyBoard}.
*
* @author upagge [08/07/2019]
*/
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public class SimpleKeyBoardLine implements KeyBoardLine {
/**
* Кнопки в строке.
*/
@Singular
protected List<KeyBoardButton> buttons;
public static SimpleKeyBoardLine simpleLine(KeyBoardButton... keyBoardButton) {
return new SimpleKeyBoardLine(Arrays.stream(keyBoardButton).toList());
}
}