Merge branch 'dev' into feature_json-task-db_M2
This commit is contained in:
@@ -56,9 +56,9 @@ public class JsonPlantDatabase implements PlantDatabase {
|
||||
* @see PlantDatabase#getPlantById(long)
|
||||
*/
|
||||
@Override
|
||||
public Optional<Plant> getPlantById(long id) throws HardinessZoneNotSetException, IOException {
|
||||
public Optional<Plant> getPlantById(HardinessZone zone, long id) throws HardinessZoneNotSetException, IOException {
|
||||
if (plantMap.isEmpty()) {
|
||||
loadPlantList(currentZone);
|
||||
loadPlantList(zone);
|
||||
}
|
||||
return Optional.ofNullable(plantMap.get(id));
|
||||
}
|
||||
|
||||
@@ -30,5 +30,5 @@ public interface PlantDatabase {
|
||||
* @throws IOException If the database cannot be accessed
|
||||
* @throws HardinessZoneNotSetException If no {@link HardinessZone} was specified
|
||||
*/
|
||||
Optional<Plant> getPlantById(long id) throws IOException, HardinessZoneNotSetException;
|
||||
Optional<Plant> getPlantById(HardinessZone zone, long id) throws IOException, HardinessZoneNotSetException;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user