Class DefaultTokenValidator

  • All Implemented Interfaces:
    TokenValidator

    @Singleton
    public class DefaultTokenValidator
    extends java.lang.Object
    implements TokenValidator
    Since:
    1.0.0
    Author:
    Sergio del Amo
    • Method Detail

      • validate

        @NonNull
        public java.util.Optional<TelegramBotConfiguration> validate​(@NonNull @NotBlank
                                                                     @NotBlank java.lang.String token)
        Specified by:
        validate in interface TokenValidator
        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.