Interface PartialResultService<Context,Result,Chunked extends ChunkedRequestContext<Context,Result>>

Type Parameters:
Context - Context type
Result - Result type
Chunked - Chunk request context
All Superinterfaces:
Function<Chunked,@Nullable Map<Context,Result>>, Service<Chunked,@Nullable Map<@NonNull Context,@NonNull Result>>

public interface PartialResultService<Context,Result,Chunked extends ChunkedRequestContext<Context,Result>> extends Service<Chunked,@Nullable Map<@NonNull Context,@NonNull Result>>
Service type that allows service to generate partial results for bigger requests
  • Method Summary

    Modifier and Type
    Method
    Description
    default @Nullable Map<@NonNull Context,@NonNull Result>
    handle(@NonNull Chunked context)
    Provide a response for the given context.
    @NonNull Map<@NonNull Context,@NonNull Result>
    handleRequests(@NonNull List<Context> requests)
    Attempt to generate results for a list of requests, and return a map of all successful requests

    Methods inherited from interface java.util.function.Function

    andThen, compose

    Methods inherited from interface cloud.commandframework.services.types.Service

    apply, order
  • Method Details

    • handle

      default @Nullable Map<@NonNull Context,@NonNull Result> handle(@NonNull Chunked context)
      Description copied from interface: Service
      Provide a response for the given context. If the service implementation cannot provide a response for the given context, it should return null
      Specified by:
      handle in interface Service<Context,Result>
      Parameters:
      context - Context used in the generation of the response
      Returns:
      Response. If the response isn't null, the next service in the service chain will get to act on the context. Otherwise the execution halts, and the provided response is the final response.
    • handleRequests

      @NonNull Map<@NonNull Context,@NonNull Result> handleRequests(@NonNull List<Context> requests)
      Attempt to generate results for a list of requests, and return a map of all successful requests
      Parameters:
      requests - Requests
      Returns:
      Map of request-result pairs