Package io.micronaut.chatbots.core
Class DefaultTextResourceLoader
java.lang.Object
io.micronaut.chatbots.core.DefaultTextResourceLoader
- All Implemented Interfaces:
TextResourceLoader
@Requires(beans={ChatbotsConfiguration.class,io.micronaut.core.io.ResourceResolver.class})
@Singleton
public class DefaultTextResourceLoader
extends 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
-
Constructor Summary
ConstructorDescriptionDefaultTextResourceLoader
(ChatbotsConfiguration chatbotsConfiguration, io.micronaut.core.io.ResourceResolver resourceResolver) -
Method Summary
Modifier and TypeMethodDescription@NonNull Optional<CommandResponse>
composeCommandResponse
(@NonNull @NotBlank String command) Composes a static command response for a given command.
-
Constructor Details
-
DefaultTextResourceLoader
public DefaultTextResourceLoader(ChatbotsConfiguration chatbotsConfiguration, io.micronaut.core.io.ResourceResolver resourceResolver)
-
-
Method Details
-
composeCommandResponse
@NonNull public @NonNull Optional<CommandResponse> composeCommandResponse(@NonNull @NotBlank @NonNull @NotBlank String command) Description copied from interface:TextResourceLoader
Composes a static command response for a given command.- Specified by:
composeCommandResponse
in interfaceTextResourceLoader
- Parameters:
command
- Command- Returns:
- static command response.
-