Interface ILocationFactory<T,L extends ILocation>
- Type Parameters:
T- The type of location.L- The location type.
- All Superinterfaces:
IFactory<T,L>
- All Known Implementing Classes:
EntityLocation.Factory,StaticLocation.Factory
Marker interface used to specify a factory for locations. Restricts the output type of the general factory interface to ILocation
-
Method Summary
Modifier and TypeMethodDescriptiongetNewInstance(@NotNull IFactoryController factoryController, T input) Method to get a new instance of a location given the input.default LgetNewInstance(@NotNull IFactoryController factoryController, T t, @NotNull Object... context) Method to get a new instance of the output given the input and additional context data.Methods inherited from interface com.minecolonies.api.colony.requestsystem.factory.IFactory
deserialize, deserialize, getFactoryInputType, getFactoryOutputType, getSerializationId, serialize, serialize
-
Method Details
-
getNewInstance
@NotNull default L 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,L extends ILocation> - Parameters:
factoryController- TheIFactoryControllerthat called this factory method.t- The input to build a new output for.context- The context of the location.- 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 location given the input.- Parameters:
factoryController- TheIFactoryControllerthat called this factory method.input- The input to build a new location for.- Returns:
- The new output instance for a given input.
-