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

  • Type Parameters:
    Context - Context type
    Result - Result type
    Chunked - Chunk request context
    All Superinterfaces:
    java.util.function.Function<Chunked,​@Nullable java.util.Map<Context,​Result>>, Service<Chunked,​@Nullable java.util.Map<@NonNull Context,​@NonNull Result>>

    public interface PartialResultService<Context,​Result,​Chunked extends ChunkedRequestContext<Context,​Result>>
    extends Service<Chunked,​@Nullable java.util.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 java.util.Map<@NonNull Context,​@NonNull Result> handle​(@NonNull Chunked context)
      Provide a response for the given context.
      @NonNull java.util.Map<@NonNull Context,​@NonNull Result> handleRequests​(@NonNull java.util.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 Detail

      • handle

        default @Nullable java.util.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 java.util.Map<@NonNull Context,​@NonNull Result> handleRequests​(@NonNull java.util.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