Interface ModernMaterialStore
- All Superinterfaces:
MaterialStore
Modern interface for polymorphic material store with async operations.
Extends the base MaterialStore with modern Java features.
- Since:
- 2024-09-15
- Version:
- 4.0
- Author:
- Navid Mohaghegh
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordBatch operation result record.static final recordModern InventoryStats using Java record for immutability.static final recordSearch criteria record for complex searches.Nested classes/interfaces inherited from interface com.university.bookstore.api.MaterialStore
MaterialStore.InventoryStats -
Method Summary
Modifier and TypeMethodDescriptionaddMaterialAsync(Material material) Adds material asynchronously.addMaterialsBatchAsync(List<Material> materials) Adds multiple materials in batch.Performs advanced search with multiple criteria.findByIdAsync(String id) Finds material by ID asynchronously.Gets inventory statistics asynchronously.Removes multiple materials in batch.searchByTitleAsync(String title) Searches by title asynchronously.Methods inherited from interface com.university.bookstore.api.MaterialStore
addMaterial, clearInventory, filterMaterials, findByCreators, findById, findRecentMaterials, findWithPredicate, getAllMaterials, getAllMaterialsSorted, getInventoryStats, getMaterialsByPriceRange, getMaterialsByType, getMaterialsByYear, getMediaMaterials, getSorted, getTotalDiscountedValue, getTotalInventoryValue, isEmpty, removeMaterial, searchByCreator, searchByTitle, size
-
Method Details
-
addMaterialAsync
Adds material asynchronously.- Parameters:
material- the material to add- Returns:
- CompletableFuture with the result
-
findByIdAsync
Finds material by ID asynchronously.- Parameters:
id- the material ID- Returns:
- CompletableFuture with the result
-
searchByTitleAsync
Searches by title asynchronously.- Parameters:
title- the title to search for- Returns:
- CompletableFuture with the results
-
getModernInventoryStatsAsync
CompletableFuture<ModernMaterialStore.ModernInventoryStats> getModernInventoryStatsAsync()Gets inventory statistics asynchronously.- Returns:
- CompletableFuture with the statistics
-
advancedSearchAsync
Performs advanced search with multiple criteria.- Parameters:
criteria- the search criteria- Returns:
- CompletableFuture with matching materials
-
addMaterialsBatchAsync
CompletableFuture<ModernMaterialStore.BatchOperationResult> addMaterialsBatchAsync(List<Material> materials) Adds multiple materials in batch.- Parameters:
materials- collection of materials to add- Returns:
- CompletableFuture with batch operation result
-
removeMaterialsBatchAsync
CompletableFuture<ModernMaterialStore.BatchOperationResult> removeMaterialsBatchAsync(List<String> ids) Removes multiple materials in batch.- Parameters:
ids- collection of IDs to remove- Returns:
- CompletableFuture with batch operation result
-