Interface TokenValidator

All Known Implementing Classes:
DefaultTokenValidator
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@DefaultImplementation(DefaultTokenValidator.class) @FunctionalInterface public interface TokenValidator
API to validate a token provided the Bot Father and return the Bot's configuration.
Since:
1.0.0
Author:
Sergio del Amo
  • Field Details

  • Method Details

    • validate

      @NonNull @NonNull Optional<TelegramBotConfiguration> validate(@NonNull @NotBlank @NonNull @NotBlank String token)
      Parameters:
      token - Telegram Token as returned by the Bot Father.
      Returns:
      Returns the TelegramBotConfiguration associated to the token. If the token is not associated with any Telegram bot an empty optional is returned.