Interface IRequestFactory<T extends IRequestable,R extends IRequest<T>>

Type Parameters:
T - The type of request.
R - The request type.
All Superinterfaces:
IFactory<T,R>
All Known Implementing Classes:
StandardRequestFactories.AbstractCraftingRequestFactory, StandardRequestFactories.BurnableRequestFactory, StandardRequestFactories.DeliveryRequestFactory, StandardRequestFactories.FoodRequestFactory, StandardRequestFactories.ItemStackListRequestFactory, StandardRequestFactories.ItemStackRequestFactory, StandardRequestFactories.ItemTagRequestFactory, StandardRequestFactories.MinimumStackRequestFactory, StandardRequestFactories.PickupRequestFactory, StandardRequestFactories.PrivateCraftingRequestFactory, StandardRequestFactories.PublicCraftingRequestFactory, StandardRequestFactories.SmeltableOreRequestFactory, StandardRequestFactories.ToolRequestFactory

public interface IRequestFactory<T extends IRequestable,R extends IRequest<T>> extends IFactory<T,R>
Marker interface used to specify a factory for requests. Restricts the output type of the general factory interface to IRequest
  • Field Details

  • Method Details

    • getNewInstance

      @NotNull default R getNewInstance(@NotNull @NotNull IFactoryController factoryController, @NotNull T t, @NotNull @NotNull Object... context) throws IllegalArgumentException
      Method to get a new instance of the output given the input and additional context data.
      Specified by:
      getNewInstance in interface IFactory<T extends IRequestable,R extends IRequest<T>>
      Parameters:
      factoryController - The factory controller that called this facotry method.
      t - The input to build a new output for.
      context - The context of the request.
      Returns:
      The new output instance for a given input.
      Throws:
      IllegalArgumentException - is thrown when the factory cannot produce a new instance out of the given context and input.
    • getNewInstance

      default R getNewInstance(@NotNull T input, @NotNull @NotNull IRequester location, @NotNull @NotNull IToken<?> token)
      Method to get a new instance of a request given the input and token.
      Parameters:
      input - The input to build a new request for.
      location - the location of the requester.
      token - The token to build the request from.
      Returns:
      The new output instance for a given input.
    • getNewInstance

      R getNewInstance(@NotNull T input, @NotNull @NotNull IRequester location, @NotNull @NotNull IToken<?> token, @NotNull @NotNull RequestState initialState)
      Method to get a new instance of a request given the input and token.
      Parameters:
      input - The input to build a new request for.
      location - the location of the requester.
      token - The token to build the request from.
      initialState - The initial state of the request request.
      Returns:
      The new output instance for a given input.