Interface DriverMapper
- All Known Implementing Classes:
FileDriverMapper
public interface DriverMapper
Interface use to implement DriverMapper. This object is use to persist
informations about drivers and offers associations.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddOffersTo(List<String> offersIdsToAdd, String driverName) Add list of offers to a driver's offers persisted list (and persists it)voidaddOfferTo(String offerId, String driverName) Add one offer to a driver's offers persisted list (and persists it)getOffersFor(String driverName) Get persisted offers list for a drivervoidremoveOffersTo(List<String> offersIdsToRemove, String driverName) Remove list of offers to a driver's offers persisted list (and persist it)voidremoveOfferTo(String offerId, String driverName) Remove one offer to a driver's offers persisted list (and persists it)
-
Method Details
-
getOffersFor
Get persisted offers list for a driver- Parameters:
driverName- the driver name- Returns:
- offers IDs list for driverName or empty list if there is actually no association
- Throws:
StorageDriverMapperException- if application cannot have information (reading error for example)
-
addOfferTo
Add one offer to a driver's offers persisted list (and persists it)- Parameters:
offerId- the offer ID to append and persistdriverName- the driver name- Throws:
StorageDriverMapperException- if application cannot have information (writing error for example)
-
addOffersTo
void addOffersTo(List<String> offersIdsToAdd, String driverName) throws StorageDriverMapperException Add list of offers to a driver's offers persisted list (and persists it)- Parameters:
offersIdsToAdd- the offers IDs list to append and persistdriverName- the driver name- Throws:
StorageDriverMapperException- if application cannot have information (writing error for example)
-
removeOfferTo
Remove one offer to a driver's offers persisted list (and persists it)- Parameters:
offerId- the offer ID to remove and persistdriverName- the driver name- Throws:
StorageDriverMapperException- if application cannot have information (writing error for example)
-
removeOffersTo
void removeOffersTo(List<String> offersIdsToRemove, String driverName) throws StorageDriverMapperException Remove list of offers to a driver's offers persisted list (and persist it)- Parameters:
offersIdsToRemove- the offers IDs list to remove and persistdriverName- the driver name- Throws:
StorageDriverMapperException- if application cannot have information (writing error for example)
-