feat: PlantDB types and interfaces
Created the types and interfaces relating to the PlantDatabase
This commit is contained in:
@@ -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);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package ch.zhaw.gartenverwaltung.types;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public record GrowthPhase(Date startDate,
|
||||
Date endDate,
|
||||
GrowthPhaseType type,
|
||||
HardinessZone zone) {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package ch.zhaw.gartenverwaltung.types;
|
||||
|
||||
public enum GrowthPhaseType {
|
||||
SOW, PLANT, HARVEST
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package ch.zhaw.gartenverwaltung.types;
|
||||
|
||||
/**
|
||||
* Represents the available hardiness zones
|
||||
* (Subject to later expansion)
|
||||
*/
|
||||
public enum HardinessZone {
|
||||
ZONE_8A
|
||||
}
|
||||
@@ -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) {
|
||||
}
|
||||
Reference in New Issue
Block a user