public PlantData addPlant( DateTime datePlanted, String name, String notes, boolean isActive, boolean isDroidFarmed) { Plant newPlant = new Plant(datePlanted, name, notes, isActive, isDroidFarmed); newPlant.save(); this.plants.add(newPlant); this.save(); return this; }
public PlantData addPlant(Plant newPlant) { if (newPlant != null) { newPlant.save(); this.plants.add(newPlant); this.save(); } else { logger.warn("newPLant was NULL"); System.out.println("newPLant was NULL"); } return this; }