File tree Expand file tree Collapse file tree
backends-for-frontends/src/main/java/com/iluwatar/bff/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,8 +36,8 @@ public interface SupplierService {
3636 /**
3737 * Retrieves supplier stock records for a product.
3838 *
39- * @param productId identifier of the product to check stock for
39+ * @param productName name of the product to check stock for
4040 * @return the list of supplier stock records for the product
4141 */
42- List <SupplierRecord > getSupplierRecords (String productId );
42+ List <SupplierRecord > getSupplierRecords (String productName );
4343}
Original file line number Diff line number Diff line change 3333public final class InMemorySupplierService implements SupplierService {
3434
3535 /** Supplier records stored in memory, keyed by product name. */
36- private final Map <String , List <SupplierRecord >> recordsByProductId ;
36+ private final Map <String , List <SupplierRecord >> recordsByProductName ;
3737
3838 /**
3939 * Creates the service with a fixed backing map of supplier records, keyed by product name.
4040 *
4141 * @param records the supplier data this service serves
4242 */
4343 public InMemorySupplierService (final Map <String , List <SupplierRecord >> records ) {
44- this .recordsByProductId = records ;
44+ this .recordsByProductName = records ;
4545 }
4646
4747 @ Override
48- public List <SupplierRecord > getSupplierRecords (final String productId ) {
49- return recordsByProductId .getOrDefault (productId , List .of ());
48+ public List <SupplierRecord > getSupplierRecords (final String productName ) {
49+ return recordsByProductName .getOrDefault (productName , List .of ());
5050 }
5151}
You can’t perform that action at this time.
0 commit comments