Interface LocationRepository
-
- All Known Implementing Classes:
LocationRepositoryImpl
public interface LocationRepositoryDefines repository operations on locations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LocationcreateLocation(Coordinates coordinates, String description)Create a location with a unique ID.Optional<Location>find(long locationId)Find a location by its ID.List<Location>locations()Get all locations.voidremoveAll()Remove all locations from the repository.LocationremoveLocation(long id)Remove a location with the given ID.
-
-
-
Method Detail
-
createLocation
Location createLocation(Coordinates coordinates, String description)
Create a location with a unique ID.- Parameters:
coordinates- location's coordinatesdescription- description of the location- Returns:
- a new location
-
removeLocation
Location removeLocation(long id)
Remove a location with the given ID.- Parameters:
id- location ID- Returns:
- the removed location
-
removeAll
void removeAll()
Remove all locations from the repository.
-
-