All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.malkusch.telgrambot.PinnedMessage Maven / Gradle / Ivy

There is a newer version: 0.0.23
Show newest version
package de.malkusch.telgrambot;

import java.util.List;

import static java.util.Arrays.asList;
import static java.util.Arrays.stream;
import static java.util.Objects.requireNonNull;

public sealed interface PinnedMessage {

    NoMessage NO_MESSAGE = new NoMessage();

    record NoMessage() implements PinnedMessage {
    }

    record TextMessage(MessageId id, String text) implements PinnedMessage {

        public TextMessage {
            requireNonNull(id);
            requireNonNull(text);
            if (text.isBlank()) {
                throw new IllegalArgumentException("text must not be empty");
            }
        }
    }

    record CallbackMessage(MessageId id, String text, List




© 2015 - 2024 Weber Informatics LLC | Privacy Policy