feat: PlantDB types and interfaces

Created the types and interfaces relating to the PlantDatabase
This commit is contained in:
David Guler 2022-10-14 15:16:27 +02:00
parent 870bd18c0f
commit bd53d0644a
5 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,12 @@
package ch.zhaw.gartenverwaltung.io;
import ch.zhaw.gartenverwaltung.types.Plant;
import ch.zhaw.gartenverwaltung.types.HardinessZone;
import java.util.List;
import java.util.Optional;
public interface PlantDatabase {
List<Plant> getPlantList(HardinessZone zone);
Optional<Plant> getPlantById(long id);
}

View File

@ -0,0 +1,9 @@
package ch.zhaw.gartenverwaltung.types;
import java.util.Date;
public record GrowthPhase(Date startDate,
Date endDate,
GrowthPhaseType type,
HardinessZone zone) {
}

View File

@ -0,0 +1,5 @@
package ch.zhaw.gartenverwaltung.types;
public enum GrowthPhaseType {
SOW, PLANT, HARVEST
}

View File

@ -0,0 +1,9 @@
package ch.zhaw.gartenverwaltung.types;
/**
* Represents the available hardiness zones
* (Subject to later expansion)
*/
public enum HardinessZone {
ZONE_8A
}

View File

@ -0,0 +1,11 @@
package ch.zhaw.gartenverwaltung.types;
import java.util.List;
public record Plant(
long id,
String name,
String description,
int spacing,
List<GrowthPhase> lifecycle) {
}