Class DefaultTextResourceLoader

  • All Implemented Interfaces:
    TextResourceLoader

    @Singleton
    public class DefaultTextResourceLoader
    extends java.lang.Object
    implements TextResourceLoader
    Users ResourceLoader to load a static resource associated with a command. For a command such as /help
    Since:
    1.0.0
    Author:
    Sergio del Amo
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<CommandResponse> composeCommandResponse​(@NotBlank java.lang.String command)
      Composes a static command response for a given command.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultTextResourceLoader

        public DefaultTextResourceLoader​(ChatbotsConfiguration chatbotsConfiguration,
                                         io.micronaut.core.io.ResourceResolver resourceResolver)
    • Method Detail

      • composeCommandResponse

        @NonNull
        public java.util.Optional<CommandResponse> composeCommandResponse​(@NonNull @NotBlank
                                                                          @NotBlank java.lang.String command)
        Description copied from interface: TextResourceLoader
        Composes a static command response for a given command.
        Specified by:
        composeCommandResponse in interface TextResourceLoader
        Parameters:
        command - Command
        Returns:
        static command response.