@Component class LocationRepositoryImpl extends Object implements LocationRepository
| Constructor and Description |
|---|
LocationRepositoryImpl(LocationCrudRepository repository) |
| Modifier and Type | Method and Description |
|---|---|
Location |
createLocation(Coordinates coordinates,
String description)
Create a location with a unique ID.
|
Optional<Location> |
find(Long locationId) |
List<Location> |
locations()
Get all locations.
|
void |
removeAll()
Remove all locations from the repository.
|
Location |
removeLocation(long id)
Remove location.
|
@Autowired LocationRepositoryImpl(LocationCrudRepository repository)
public Location createLocation(Coordinates coordinates, String description)
LocationRepositorycreateLocation in interface LocationRepositorycoordinates - location's coordinatesdescription - description of the locationpublic List<Location> locations()
LocationRepositorylocations in interface LocationRepositorypublic Location removeLocation(long id)
LocationRepositoryremoveLocation in interface LocationRepositoryid - location's idpublic void removeAll()
LocationRepositoryremoveAll in interface LocationRepositorypublic Optional<Location> find(Long locationId)
find in interface LocationRepositoryCopyright © 2001–2020 JBoss by Red Hat. All rights reserved.