Class AttachmentDataParser.Resources
java.lang.Object
dev.sympho.modular_commands.api.command.parameter.parse.AttachmentDataParser.Resources
- Enclosing interface:
- AttachmentDataParser<T extends @NonNull Object>
Resources used by an instance.
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
A function that determines the HTTP client that should be used to fetch an attachment's data based on the execution context. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AttachmentDataParser.Resources.HttpClientRetriever
The defaultHTTP client getter
. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the function to be used to obtain an HTTP client for fetching attachment data unless overriden by the parser.Sets the given function to be used to obtain an HTTP client for fetching attachment data unless overriden by the parser.setClientGetter
(Supplier<? extends reactor.netty.http.client.HttpClient> supplier) Sets the given supplier to be used to obtain an HTTP client for fetching attachment data unless overriden by the parser.setClientGetter
(reactor.netty.http.client.HttpClient client) Sets the given HTTP client to be used for fetching attachment data unless overriden by the parser.
-
Field Details
-
DEFAULT_CLIENT_GETTER
The defaultHTTP client getter
.It uses the client in the
reactor resources
of the invokingdiscord client
'score resources
(the client used for interacting with Discord's API).
-
-
Method Details
-
setClientGetter
public AttachmentDataParser.Resources.HttpClientRetriever setClientGetter(AttachmentDataParser.Resources.HttpClientRetriever getter) Sets the given function to be used to obtain an HTTP client for fetching attachment data unless overriden by the parser.- Parameters:
getter
- The getter function to use.- Returns:
- The getter that was replaced.
-
setClientGetter
public AttachmentDataParser.Resources.HttpClientRetriever setClientGetter(Supplier<? extends reactor.netty.http.client.HttpClient> supplier) Sets the given supplier to be used to obtain an HTTP client for fetching attachment data unless overriden by the parser.- Parameters:
supplier
- The supplier to use.- Returns:
- The getter that was replaced.
-
setClientGetter
public AttachmentDataParser.Resources.HttpClientRetriever setClientGetter(reactor.netty.http.client.HttpClient client) Sets the given HTTP client to be used for fetching attachment data unless overriden by the parser.- Parameters:
client
- The client to use.- Returns:
- The getter that was replaced.
-
getClientGetter
Retrieves the function to be used to obtain an HTTP client for fetching attachment data unless overriden by the parser.- Returns:
- The getter function.
-