Beispiel #1
0
  @Override
  public void mergeWith(IdentifiableObject other) {
    super.mergeWith(other);

    if (other.getClass().isInstance(this)) {
      Chart chart = (Chart) other;

      series = chart.getSeries();
      category = chart.getCategory();
      rewindRelativePeriods = chart.isRewindRelativePeriods();
    }
  }
  @Override
  public void mergeWith(IdentifiableObject other) {
    super.mergeWith(other);

    if (other.getClass().isInstance(this)) {
      Map map = (Map) other;

      user = map.getUser() == null ? user : map.getUser();
      longitude = map.getLongitude() == null ? longitude : map.getLongitude();
      latitude = map.getLatitude() == null ? latitude : map.getLatitude();
      zoom = map.getZoom() == null ? zoom : map.getZoom();

      mapViews.clear();
      mapViews.addAll(map.getMapViews());
    }
  }
Beispiel #3
0
  @Override
  public void mergeWith(IdentifiableObject other) {
    super.mergeWith(other);

    if (other.getClass().isInstance(this)) {
      DataDictionary dataDictionary = (DataDictionary) other;

      description =
          dataDictionary.getDescription() == null ? description : dataDictionary.getDescription();
      region = dataDictionary.getRegion() == null ? region : dataDictionary.getRegion();

      removeAllDataElements();
      dataElements.addAll(dataDictionary.getDataElements());

      removeAllIndicators();
      indicators.addAll(dataDictionary.getIndicators());
    }
  }
  @Override
  public void mergeWith(IdentifiableObject other, MergeStrategy strategy) {
    super.mergeWith(other, strategy);

    if (other.getClass().isInstance(this)) {
      CategoryOptionGroupSet categoryOptionGroupSet = (CategoryOptionGroupSet) other;

      if (strategy.isReplace()) {
        dataDimensionType = categoryOptionGroupSet.getDataDimensionType();
      } else if (strategy.isMerge()) {
        dataDimensionType =
            categoryOptionGroupSet.getDataDimensionType() == null
                ? dataDimensionType
                : categoryOptionGroupSet.getDataDimensionType();
      }

      members.clear();

      for (CategoryOptionGroup categoryOptionGroup : categoryOptionGroupSet.getMembers()) {
        addCategoryOptionGroup(categoryOptionGroup);
      }
    }
  }
Beispiel #5
0
  @Override
  public void mergeWith(IdentifiableObject other) {
    super.mergeWith(other);

    if (other.getClass().isInstance(this)) {
      ProgramStage programStage = (ProgramStage) other;

      description = programStage.getDescription();
      minDaysFromStart = programStage.getMinDaysFromStart();
      irregular = programStage.getIrregular();
      program = programStage.getProgram();
      dataEntryForm = programStage.getDataEntryForm();
      standardInterval = programStage.getStandardInterval();
      reportDateDescription = programStage.getReportDateDescription();
      autoGenerateEvent = programStage.isAutoGenerated();
      validCompleteOnly = programStage.getValidCompleteOnly();
      displayGenerateEventBox = programStage.getDisplayGenerateEventBox();
      captureCoordinates = programStage.getCaptureCoordinates();
      blockEntryForm = programStage.getBlockEntryForm();
      remindCompleted = programStage.getRemindCompleted();
      generatedByEnrollmentDate = programStage.getGeneratedByEnrollmentDate();
      allowGenerateNextVisit = programStage.getAllowGenerateNextVisit();
      openAfterEnrollment = programStage.getOpenAfterEnrollment();
      reportDateToUse = programStage.getReportDateToUse();
      preGenerateUID = programStage.getPreGenerateUID();

      programStageDataElements.clear();
      programStageDataElements.addAll(programStage.getProgramStageDataElements());

      programStageSections.clear();
      programStageSections.addAll(programStage.getProgramStageSections());

      reminders.clear();
      reminders.addAll(programStage.getReminders());
    }
  }