Interface ITokenFactory<T,RT extends IToken<?>>
- Type Parameters:
T- The type of requesttoken.RT- The requesttoken type.
- All Superinterfaces:
IFactory<T,RT>
- All Known Implementing Classes:
AbstractTokenFactory,InitializedTokenFactory,RandomSeededTokenFactory,StandardTokenFactory
Marker interface used to specify a factory for requesttokens. Restricts the output type of the general factory interface to IToken
-
Method Summary
Modifier and TypeMethodDescriptiondefault RTgetNewInstance(@NotNull IFactoryController factoryController, T t, @NotNull Object... context) Method to get a new instance of the output given the input and additional context data.getNewInstance(T input) Method to get a new instance of a token given the input and token.Methods inherited from interface com.minecolonies.api.colony.requestsystem.factory.IFactory
deserialize, deserialize, getFactoryInputType, getFactoryOutputType, getSerializationId, serialize, serialize
-
Method Details
-
getNewInstance
@NotNull default RT 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:
getNewInstancein interfaceIFactory<T,RT extends IToken<?>> - Parameters:
factoryController- The factory controller that calls the factory method.t- The input to build a new output for.context- The context of the token.- 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
Method to get a new instance of a token given the input and token.- Parameters:
input- The input to build a new token for.- Returns:
- The new output instance for a given input.
-