Interface DriverMapper
-
- All Known Implementing Classes:
FileDriverMapper
public interface DriverMapperInterface use to implement DriverMapper. This object is use to persist informations about drivers and offers associations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddOffersTo(java.util.List<java.lang.String> offersIdsToAdd, java.lang.String driverName)Add list of offers to a driver's offers persisted list (and persists it)voidaddOfferTo(java.lang.String offerId, java.lang.String driverName)Add one offer to a driver's offers persisted list (and persists it)java.util.List<java.lang.String>getOffersFor(java.lang.String driverName)Get persisted offers list for a drivervoidremoveOffersTo(java.util.List<java.lang.String> offersIdsToRemove, java.lang.String driverName)Remove list of offers to a driver's offers persisted list (and persist it)voidremoveOfferTo(java.lang.String offerId, java.lang.String driverName)Remove one offer to a driver's offers persisted list (and persists it)
-
-
-
Method Detail
-
getOffersFor
java.util.List<java.lang.String> getOffersFor(java.lang.String driverName) throws StorageDriverMapperExceptionGet 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
void addOfferTo(java.lang.String offerId, java.lang.String driverName) throws StorageDriverMapperExceptionAdd 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(java.util.List<java.lang.String> offersIdsToAdd, java.lang.String driverName) throws StorageDriverMapperExceptionAdd 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
void removeOfferTo(java.lang.String offerId, java.lang.String driverName) throws StorageDriverMapperExceptionRemove 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(java.util.List<java.lang.String> offersIdsToRemove, java.lang.String driverName) throws StorageDriverMapperExceptionRemove 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)
-
-