Merge branch 'dev' into feature_json-gardenplan_M2

This commit is contained in:
gulerdav
2022-10-28 11:43:45 +02:00
committed by GitHub Enterprise
7 changed files with 255 additions and 4 deletions
@@ -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;
}