Package org.variantsync.boosting.product
Class ProductLoadTask
java.lang.Object
org.variantsync.boosting.product.ProductLoadTask
- All Implemented Interfaces:
Callable<ProductLoadTask.LoadResult>
A Callable task that loads a product from a given file path.
The task reads the product object from the file using ObjectInputStream and
returns a LoadResult object.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Represents the result of loading a product, containing the product ID and product object. -
Constructor Summary
ConstructorsConstructorDescriptionProductLoadTask
(Path productPath) Constructs a ProductLoadTask with the given product file path. -
Method Summary
Modifier and TypeMethodDescriptioncall()
Loads the product from the file and returns a LoadResult object.static void
Resets the processed count to zero.
-
Constructor Details
-
ProductLoadTask
Constructs a ProductLoadTask with the given product file path. Parses the product ID from the file name.- Parameters:
productPath
- The file path of the product to load
-
-
Method Details
-
call
Loads the product from the file and returns a LoadResult object.- Specified by:
call
in interfaceCallable<ProductLoadTask.LoadResult>
- Returns:
- LoadResult An object containing the loaded product ID and product object
- Throws:
UncheckedIOException
- If an IOException occurs while reading the fileRuntimeException
- If the Product class is not foundException
-
resetProcessedCount
public static void resetProcessedCount()Resets the processed count to zero.
-