Пример #1
0
  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;
  }
Пример #2
0
  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;
  }