← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18433: change domain classes to use strategy.isReplace / .isMerge

 

------------------------------------------------------------
revno: 18433
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-02-26 22:21:29 +0700
message:
  change domain classes to use strategy.isReplace / .isMerge
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/BaseChart.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseDimensionalObject.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseNameableObject.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardItem.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroup.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroup.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/Section.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/document/Document.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventchart/EventChart.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/legend/Legend.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/legend/LegendSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/Map.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapLayer.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/message/MessageConversation.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageSection.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidation.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipType.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttribute.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeGroup.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityForm.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminder.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserAuthorityGroup.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRuleGroup.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java	2015-02-26 15:21:29 +0000
@@ -309,12 +309,12 @@
             programAttribute = attribute.isProgramAttribute();
             mandatory = attribute.isMandatory();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 valueType = attribute.getValueType();
                 sortOrder = attribute.getSortOrder();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 valueType = attribute.getValueType() == null ? valueType : attribute.getValueType();
                 sortOrder = attribute.getSortOrder() == null ? sortOrder : attribute.getSortOrder();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/BaseChart.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/BaseChart.java	2015-02-19 09:18:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/BaseChart.java	2015-02-26 15:21:29 +0000
@@ -521,7 +521,7 @@
             showData = chart.isShowData();
             hideEmptyRows = chart.isHideEmptyRows();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 domainAxisLabel = chart.getDomainAxisLabel();
                 rangeAxisLabel = chart.getRangeAxisLabel();
@@ -536,7 +536,7 @@
                 rangeAxisSteps = chart.getRangeAxisSteps();
                 rangeAxisDecimals = chart.getRangeAxisDecimals();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 domainAxisLabel = chart.getDomainAxisLabel() == null ? domainAxisLabel : chart.getDomainAxisLabel();
                 rangeAxisLabel = chart.getRangeAxisLabel() == null ? rangeAxisLabel : chart.getRangeAxisLabel();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2015-02-26 15:21:29 +0000
@@ -255,12 +255,12 @@
 
             rewindRelativePeriods = chart.isRewindRelativePeriods();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 series = chart.getSeries();
                 category = chart.getCategory();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 series = chart.getSeries() == null ? series : chart.getSeries();
                 category = chart.getCategory() == null ? category : chart.getCategory();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java	2015-02-25 20:40:28 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java	2015-02-26 15:21:29 +0000
@@ -763,11 +763,11 @@
 
             this.clear();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 relatives = object.getRelatives();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 relatives = object.getRelatives() == null ? relatives : object.getRelatives();
             }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseDimensionalObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseDimensionalObject.java	2015-02-25 20:40:28 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseDimensionalObject.java	2015-02-26 15:21:29 +0000
@@ -265,14 +265,14 @@
         {
             DimensionalObject dimensionalObject = (DimensionalObject) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 dimensionType = dimensionalObject.getDimensionType();
                 dimensionName = dimensionalObject.getDimensionName();
                 legendSet = dimensionalObject.getLegendSet();
                 filter = dimensionalObject.getFilter();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 dimensionType = dimensionalObject.getDimensionType() == null ? dimensionType : dimensionalObject.getDimensionType();
                 dimensionName = dimensionalObject.getDimensionName() == null ? dimensionName : dimensionalObject.getDimensionName();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java	2015-02-19 09:18:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java	2015-02-26 15:21:29 +0000
@@ -544,7 +544,7 @@
     {
         Validate.notNull( other );
 
-        if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+        if ( strategy.isReplace() )
         {
             uid = other.getUid();
             name = other.getName();
@@ -553,7 +553,7 @@
             created = other.getCreated();
             user = other.getUser();
         }
-        else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+        else if ( strategy.isMerge() )
         {
             uid = other.getUid() == null ? uid : other.getUid();
             name = other.getName() == null ? name : other.getName();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseNameableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseNameableObject.java	2015-02-16 04:03:32 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseNameableObject.java	2015-02-26 15:21:29 +0000
@@ -228,12 +228,12 @@
         {
             NameableObject nameableObject = (NameableObject) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 this.shortName = nameableObject.getShortName();
                 this.description = nameableObject.getDescription();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 this.shortName = nameableObject.getShortName() == null ? this.shortName : nameableObject.getShortName();
                 this.description = nameableObject.getDescription() == null ? this.description : nameableObject.getDescription();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardItem.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardItem.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardItem.java	2015-02-26 15:21:29 +0000
@@ -432,7 +432,7 @@
         {
             DashboardItem dashboardItem = (DashboardItem) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 chart = dashboardItem.getChart();
                 map = dashboardItem.getMap();
@@ -443,7 +443,7 @@
                 messages = dashboardItem.getMessages();
                 shape = dashboardItem.getShape();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 chart = dashboardItem.getChart() == null ? chart : dashboardItem.getChart();
                 map = dashboardItem.getMap() == null ? map : dashboardItem.getMap();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroup.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroup.java	2015-02-26 15:21:29 +0000
@@ -131,11 +131,11 @@
         {
             CategoryOptionGroup categoryOptionGroup = (CategoryOptionGroup) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 groupSet = categoryOptionGroup.getGroupSet() == null ? groupSet : categoryOptionGroup.getGroupSet();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 groupSet = categoryOptionGroup.getGroupSet();
             }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2015-02-25 17:10:19 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2015-02-26 15:21:29 +0000
@@ -729,7 +729,7 @@
 
             zeroIsSignificant = dataElement.isZeroIsSignificant();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 formName = dataElement.getFormName();
                 domainType = dataElement.getDomainType();
@@ -741,7 +741,7 @@
                 url = dataElement.getUrl();
                 optionSet = dataElement.getOptionSet();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 formName = dataElement.getFormName() == null ? formName : dataElement.getFormName();
                 domainType = dataElement.getDomainType() == null ? domainType : dataElement.getDomainType();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java	2015-02-26 15:21:29 +0000
@@ -231,11 +231,11 @@
         {
             DataElementCategory category = (DataElementCategory) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 dataDimensionType = category.getDataDimensionType();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 dataDimensionType = category.getDataDimensionType() == null ? dataDimensionType : category.getDataDimensionType();
             }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java	2015-02-26 15:21:29 +0000
@@ -269,12 +269,12 @@
         {
             DataElementCategoryOption categoryOption = (DataElementCategoryOption) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 startDate = categoryOption.getStartDate();
                 endDate = categoryOption.getEndDate();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 startDate = categoryOption.getStartDate() == null ? startDate : categoryOption.getStartDate();
                 endDate = categoryOption.getEndDate() == null ? endDate : categoryOption.getEndDate();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java	2015-02-26 15:21:29 +0000
@@ -402,11 +402,11 @@
         {
             DataElementCategoryOptionCombo categoryOptionCombo = (DataElementCategoryOptionCombo) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 categoryCombo = categoryOptionCombo.getCategoryCombo();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 categoryCombo = categoryOptionCombo.getCategoryCombo() == null ? categoryCombo : categoryOptionCombo.getCategoryCombo();
             }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroup.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroup.java	2015-02-26 15:21:29 +0000
@@ -210,11 +210,11 @@
         {
             DataElementGroup dataElementGroup = (DataElementGroup) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 groupSet = dataElementGroup.getGroupSet();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 groupSet = dataElementGroup.getGroupSet() == null ? groupSet : dataElementGroup.getGroupSet();
             }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java	2015-02-26 15:21:29 +0000
@@ -279,12 +279,12 @@
 
             dataDimension = dataElementGroupSet.isDataDimension();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 description = dataElementGroupSet.getDescription();
                 compulsory = dataElementGroupSet.isCompulsory();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 description = dataElementGroupSet.getDescription() == null ? description : dataElementGroupSet.getDescription();
                 compulsory = dataElementGroupSet.isCompulsory() == null ? compulsory : dataElementGroupSet.isCompulsory();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2015-02-24 13:16:58 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2015-02-26 15:21:29 +0000
@@ -819,14 +819,14 @@
             validCompleteOnly = dataSet.isValidCompleteOnly();
             version = dataSet.getVersion();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 periodType = dataSet.getPeriodType();
                 dataEntryForm = dataSet.getDataEntryForm();
                 legendSet = dataSet.getLegendSet();
                 notificationRecipients = dataSet.getNotificationRecipients();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 periodType = dataSet.getPeriodType() == null ? periodType : dataSet.getPeriodType();
                 dataEntryForm = dataSet.getDataEntryForm() == null ? dataEntryForm : dataSet.getDataEntryForm();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/Section.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/Section.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/Section.java	2015-02-26 15:21:29 +0000
@@ -272,11 +272,11 @@
         {
             Section section = (Section) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 dataSet = section.getDataSet();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 dataSet = section.getDataSet() == null ? dataSet : section.getDataSet();
             }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/document/Document.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/document/Document.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/document/Document.java	2015-02-26 15:21:29 +0000
@@ -138,12 +138,12 @@
 
             external = document.isExternal();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 url = document.getUrl();
                 contentType = document.getContentType();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 url = document.getUrl() == null ? url : document.getUrl();
                 contentType = document.getContentType() == null ? contentType : document.getContentType();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventchart/EventChart.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventchart/EventChart.java	2015-02-18 17:42:47 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventchart/EventChart.java	2015-02-26 15:21:29 +0000
@@ -390,7 +390,7 @@
         {
             EventChart chart = (EventChart) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 dataElementValueDimension = chart.getDataElementValueDimension();
                 attributeValueDimension = chart.getAttributeValueDimension();
@@ -401,7 +401,7 @@
                 endDate = chart.getEndDate();
                 outputType = chart.getOutputType();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 dataElementValueDimension = chart.getDataElementValueDimension() == null ? dataElementValueDimension : chart.getDataElementValueDimension();
                 attributeValueDimension = chart.getAttributeValueDimension() == null ? attributeValueDimension : chart.getAttributeValueDimension();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java	2015-02-18 17:42:47 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java	2015-02-26 15:21:29 +0000
@@ -560,7 +560,7 @@
             showHierarchy = report.isShowHierarchy();
             showDimensionLabels = report.isShowDimensionLabels();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 dataElementValueDimension = report.getDataElementValueDimension();
                 attributeValueDimension = report.getAttributeValueDimension();
@@ -574,7 +574,7 @@
                 displayDensity = report.getDisplayDensity();
                 fontSize = report.getFontSize();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 dataElementValueDimension = report.getDataElementValueDimension() == null ? dataElementValueDimension : report.getDataElementValueDimension();
                 attributeValueDimension = report.getAttributeValueDimension() == null ? attributeValueDimension : report.getAttributeValueDimension();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java	2015-02-24 13:16:58 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java	2015-02-26 15:21:29 +0000
@@ -378,7 +378,7 @@
 
             annualized = indicator.isAnnualized();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 denominator = indicator.getDenominator();
                 denominatorDescription = indicator.getDenominatorDescription();
@@ -389,7 +389,7 @@
                 indicatorType = indicator.getIndicatorType();
                 legendSet = indicator.getLegendSet();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 denominator = indicator.getDenominator() == null ? denominator : indicator.getDenominator();
                 denominatorDescription = indicator.getDenominatorDescription() == null ? denominatorDescription : indicator.getDenominatorDescription();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java	2015-02-26 15:21:29 +0000
@@ -187,11 +187,11 @@
         {
             IndicatorGroup indicatorGroup = (IndicatorGroup) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 groupSet = indicatorGroup.getGroupSet();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 groupSet = indicatorGroup.getGroupSet() == null ? groupSet : indicatorGroup.getGroupSet();
             }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java	2015-02-26 15:21:29 +0000
@@ -243,12 +243,12 @@
         {
             IndicatorGroupSet indicatorGroupSet = (IndicatorGroupSet) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 compulsory = indicatorGroupSet.isCompulsory();
                 description = indicatorGroupSet.getDescription();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 compulsory = indicatorGroupSet.isCompulsory() == null ? compulsory : indicatorGroupSet.isCompulsory();
                 description = indicatorGroupSet.getDescription() == null ? description : indicatorGroupSet.getDescription();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/legend/Legend.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/legend/Legend.java	2015-02-24 13:16:58 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/legend/Legend.java	2015-02-26 15:21:29 +0000
@@ -138,14 +138,14 @@
         {
             Legend legend = (Legend) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 startValue = legend.getStartValue();
                 endValue = legend.getEndValue();
                 color = legend.getColor();
                 image = legend.getImage();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 startValue = legend.getStartValue() == null ? startValue : legend.getStartValue();
                 endValue = legend.getEndValue() == null ? endValue : legend.getEndValue();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/legend/LegendSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/legend/LegendSet.java	2015-02-24 13:16:58 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/legend/LegendSet.java	2015-02-26 15:21:29 +0000
@@ -119,11 +119,11 @@
         {
             LegendSet legendSet = (LegendSet) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 symbolizer = legendSet.getSymbolizer();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 symbolizer = legendSet.getSymbolizer() == null ? symbolizer : legendSet.getSymbolizer();
             }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/Map.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/Map.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/Map.java	2015-02-26 15:21:29 +0000
@@ -148,14 +148,14 @@
         {
             Map map = (Map) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 user = map.getUser();
                 longitude = map.getLongitude();
                 latitude = map.getLatitude();
                 zoom = map.getZoom();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 user = map.getUser() == null ? user : map.getUser();
                 longitude = map.getLongitude() == null ? longitude : map.getLongitude();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapLayer.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapLayer.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapLayer.java	2015-02-26 15:21:29 +0000
@@ -205,7 +205,7 @@
             strokeWidth = mapLayer.getStrokeWidth();
             fillOpacity = mapLayer.getFillOpacity();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 type = mapLayer.getType();
                 url = mapLayer.getUrl();
@@ -214,7 +214,7 @@
                 fillColor = mapLayer.getFillColor();
                 strokeColor = mapLayer.getStrokeColor();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 type = mapLayer.getType() == null ? type : mapLayer.getType();
                 url = mapLayer.getUrl() == null ? url : mapLayer.getUrl();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java	2015-02-24 13:16:58 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java	2015-02-26 15:21:29 +0000
@@ -473,7 +473,7 @@
         {
             MapView mapView = (MapView) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 layer = mapView.getLayer();
                 method = mapView.getMethod();
@@ -493,7 +493,7 @@
                 labelFontStyle = mapView.getLabelFontStyle();
                 labelFontColor = mapView.getLabelFontColor();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 layer = mapView.getLayer() == null ? layer : mapView.getLayer();
                 method = mapView.getMethod() == null ? method : mapView.getMethod();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/message/MessageConversation.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/message/MessageConversation.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/message/MessageConversation.java	2015-02-26 15:21:29 +0000
@@ -454,13 +454,13 @@
         {
             MessageConversation messageConversation = (MessageConversation) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 subject = messageConversation.getSubject();
                 lastSender = messageConversation.getLastSender();
                 lastMessage = messageConversation.getLastMessage();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 subject = messageConversation.getSubject() == null ? subject : messageConversation.getSubject();
                 lastSender = messageConversation.getLastSender() == null ? lastSender : messageConversation.getLastSender();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2015-02-19 09:18:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2015-02-26 15:21:29 +0000
@@ -1104,7 +1104,7 @@
         {
             OrganisationUnit organisationUnit = (OrganisationUnit) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 openingDate = organisationUnit.getOpeningDate();
                 closedDate = organisationUnit.getClosedDate();
@@ -1118,7 +1118,7 @@
                 phoneNumber = organisationUnit.getPhoneNumber();
                 parent = organisationUnit.getParent();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 openingDate = organisationUnit.getOpeningDate() == null ? openingDate : organisationUnit.getOpeningDate();
                 closedDate = organisationUnit.getClosedDate() == null ? closedDate : organisationUnit.getClosedDate();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java	2015-02-26 15:21:29 +0000
@@ -203,12 +203,12 @@
         {
             OrganisationUnitGroup organisationUnitGroup = (OrganisationUnitGroup) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 groupSet = organisationUnitGroup.getGroupSet();
                 symbol = organisationUnitGroup.getSymbol();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 groupSet = organisationUnitGroup.getGroupSet() == null ? groupSet : organisationUnitGroup.getGroupSet();
                 symbol = organisationUnitGroup.getSymbol() == null ? symbol : organisationUnitGroup.getSymbol();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java	2015-02-26 15:21:29 +0000
@@ -286,11 +286,11 @@
             compulsory = organisationUnitGroupSet.isCompulsory();
             dataDimension = organisationUnitGroupSet.isDataDimension();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 description = organisationUnitGroupSet.getDescription();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 description = organisationUnitGroupSet.getDescription() == null ? description : organisationUnitGroupSet.getDescription();
             }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2015-02-24 23:41:01 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2015-02-26 15:21:29 +0000
@@ -613,7 +613,7 @@
 
             version = program.getVersion();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 description = program.getDescription();
                 dateOfEnrollmentDescription = program.getDateOfEnrollmentDescription();
@@ -631,7 +631,7 @@
                 dataEntryMethod = program.getDataEntryMethod();
                 trackedEntity = program.getTrackedEntity();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 description = program.getDescription() == null ? description : program.getDescription();
                 dateOfEnrollmentDescription = program.getDateOfEnrollmentDescription() == null ? dateOfEnrollmentDescription : program.getDateOfEnrollmentDescription();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java	2015-02-16 17:57:07 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java	2015-02-26 15:21:29 +0000
@@ -161,14 +161,14 @@
         {
             ProgramIndicator programIndicator = (ProgramIndicator) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 valueType = programIndicator.getValueType();
                 expression = programIndicator.getExpression();
                 rootDate = programIndicator.getRootDate();
                 program = programIndicator.getProgram();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 valueType = programIndicator.getValueType() == null ? valueType : programIndicator.getValueType();
                 expression = programIndicator.getExpression() == null ? expression : programIndicator.getExpression();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2015-02-26 15:21:29 +0000
@@ -483,7 +483,7 @@
             minDaysFromStart = programStage.getMinDaysFromStart();
             autoGenerateEvent = programStage.isAutoGenerated();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 description = programStage.getDescription();
                 irregular = programStage.getIrregular();
@@ -502,7 +502,7 @@
                 reportDateToUse = programStage.getReportDateToUse();
                 preGenerateUID = programStage.getPreGenerateUID();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 description = programStage.getDescription() == null ? description : programStage.getDescription();
                 irregular = programStage.getIrregular() == null ? irregular : programStage.getIrregular();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageSection.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageSection.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageSection.java	2015-02-26 15:21:29 +0000
@@ -137,12 +137,12 @@
         {
             ProgramStageSection programStageSection = (ProgramStageSection) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 programStage = programStageSection.getProgramStage();
                 sortOrder = programStageSection.getSortOrder();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 programStage = programStageSection.getProgramStage() == null ? programStage : programStageSection.getProgramStage();
                 sortOrder = programStageSection.getSortOrder() == null ? sortOrder : programStageSection.getSortOrder();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidation.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidation.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidation.java	2015-02-26 15:21:29 +0000
@@ -153,14 +153,14 @@
         {
             ProgramValidation programValidation = (ProgramValidation) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 leftSide = programValidation.getLeftSide();
                 operator = programValidation.getOperator();
                 rightSide = programValidation.getRightSide();
                 program = programValidation.getProgram();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 leftSide = programValidation.getLeftSide() == null ? leftSide : programValidation.getLeftSide();
                 rightSide = programValidation.getRightSide() == null ? rightSide : programValidation.getRightSide();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipType.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipType.java	2015-02-26 15:21:29 +0000
@@ -122,12 +122,12 @@
         {
             RelationshipType relationshipType = (RelationshipType) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 aIsToB = relationshipType.getaIsToB();
                 bIsToA = relationshipType.getbIsToA();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 aIsToB = relationshipType.getaIsToB() == null ? aIsToB : relationshipType.getaIsToB();
                 bIsToA = relationshipType.getbIsToA() == null ? bIsToA : relationshipType.getbIsToA();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java	2015-02-26 15:21:29 +0000
@@ -216,12 +216,12 @@
         {
             Report report = (Report) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 designContent = report.getDesignContent();
                 reportTable = report.getReportTable();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 designContent = report.getDesignContent() == null ? designContent : report.getDesignContent();
                 reportTable = report.getReportTable() == null ? reportTable : report.getReportTable();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2015-02-24 13:16:58 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2015-02-26 15:21:29 +0000
@@ -1104,7 +1104,7 @@
             topLimit = reportTable.getTopLimit();
             sortOrder = reportTable.getSortOrder();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 reportParams = reportTable.getReportParams();
                 aggregationType = reportTable.getAggregationType();
@@ -1112,7 +1112,7 @@
                 fontSize = reportTable.getFontSize();
                 legendSet = reportTable.getLegendSet();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 reportParams = reportTable.getReportParams() == null ? reportParams : reportTable.getReportParams();
                 aggregationType = reportTable.getAggregationType() == null ? aggregationType : reportTable.getAggregationType();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java	2015-02-19 13:51:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java	2015-02-26 15:21:29 +0000
@@ -230,13 +230,13 @@
         {
             SqlView sqlView = (SqlView) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 description = sqlView.getDescription();
                 sqlQuery = sqlView.getSqlQuery();
                 query = sqlView.isQuery();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 description = sqlView.getDescription() == null ? description : sqlView.getDescription();
                 sqlQuery = sqlView.getSqlQuery() == null ? sqlQuery : sqlView.getSqlQuery();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttribute.java	2015-02-25 17:10:19 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttribute.java	2015-02-26 15:21:29 +0000
@@ -358,7 +358,7 @@
         {
             TrackedEntityAttribute trackedEntityAttribute = (TrackedEntityAttribute) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 description = trackedEntityAttribute.getDescription();
                 valueType = trackedEntityAttribute.getValueType();
@@ -374,7 +374,7 @@
                 programScope = trackedEntityAttribute.getProgramScope();
                 confidential = trackedEntityAttribute.getConfidential();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 description = trackedEntityAttribute.getDescription() == null ? description : trackedEntityAttribute.getDescription();
                 valueType = trackedEntityAttribute.getValueType() == null ? valueType : trackedEntityAttribute.getValueType();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeGroup.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeGroup.java	2015-02-26 15:21:29 +0000
@@ -125,11 +125,11 @@
         {
             TrackedEntityAttributeGroup trackedEntityAttributeGroup = (TrackedEntityAttributeGroup) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 description = trackedEntityAttributeGroup.getDescription();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 description = trackedEntityAttributeGroup.getDescription() == null ? description : trackedEntityAttributeGroup.getDescription();
             }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityForm.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityForm.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityForm.java	2015-02-26 15:21:29 +0000
@@ -143,12 +143,12 @@
         {
             TrackedEntityForm trackedEntityForm = (TrackedEntityForm) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 program = trackedEntityForm.getProgram();
                 dataEntryForm = trackedEntityForm.getDataEntryForm();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 program = trackedEntityForm.getProgram() == null ? program : trackedEntityForm.getProgram();
                 dataEntryForm = trackedEntityForm.getDataEntryForm() == null ? dataEntryForm : trackedEntityForm.getDataEntryForm();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminder.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminder.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminder.java	2015-02-26 15:21:29 +0000
@@ -252,7 +252,7 @@
         {
             TrackedEntityInstanceReminder trackedEntityInstanceReminder = (TrackedEntityInstanceReminder) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 daysAllowedSendMessage = trackedEntityInstanceReminder.getDaysAllowedSendMessage();
                 templateMessage = trackedEntityInstanceReminder.getTemplateMessage();
@@ -262,7 +262,7 @@
                 messageType = trackedEntityInstanceReminder.getMessageType();
                 userGroup = trackedEntityInstanceReminder.getUserGroup();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 daysAllowedSendMessage = trackedEntityInstanceReminder.getDaysAllowedSendMessage() == null ? daysAllowedSendMessage : trackedEntityInstanceReminder.getDaysAllowedSendMessage();
                 templateMessage = trackedEntityInstanceReminder.getTemplateMessage() == null ? templateMessage : trackedEntityInstanceReminder.getTemplateMessage();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2015-02-13 12:51:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2015-02-26 15:21:29 +0000
@@ -640,7 +640,7 @@
         {
             User user = (User) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 surname = user.getSurname();
                 firstName = user.getFirstName();
@@ -658,7 +658,7 @@
                 lastCheckedInterpretations = user.getLastCheckedInterpretations();
                 userCredentials = user.getUserCredentials();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 surname = user.getSurname() == null ? surname : user.getSurname();
                 firstName = user.getFirstName() == null ? firstName : user.getFirstName();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserAuthorityGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserAuthorityGroup.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserAuthorityGroup.java	2015-02-26 15:21:29 +0000
@@ -212,11 +212,11 @@
         {
             UserAuthorityGroup userAuthorityGroup = (UserAuthorityGroup) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 description = userAuthorityGroup.getDescription();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 description = userAuthorityGroup.getDescription() == null ? description : userAuthorityGroup.getDescription();
             }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java	2015-02-26 15:21:29 +0000
@@ -687,11 +687,11 @@
             selfRegistered = userCredentials.isSelfRegistered();
             disabled = userCredentials.isDisabled();
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 openId = userCredentials.getOpenId();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 openId = userCredentials.getOpenId() == null ? openId : userCredentials.getOpenId();
             }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java	2015-02-26 15:21:29 +0000
@@ -487,13 +487,13 @@
         {
             ValidationRule validationRule = (ValidationRule) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 description = validationRule.getDescription();
                 operator = validationRule.getOperator();
                 periodType = validationRule.getPeriodType();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 description = validationRule.getDescription() == null ? description : validationRule.getDescription();
                 operator = validationRule.getOperator() == null ? operator : validationRule.getOperator();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRuleGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRuleGroup.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRuleGroup.java	2015-02-26 15:21:29 +0000
@@ -185,11 +185,11 @@
         {
             ValidationRuleGroup validationRuleGroup = (ValidationRuleGroup) other;
 
-            if ( MergeStrategy.MERGE_ALWAYS.equals( strategy ) )
+            if ( strategy.isReplace() )
             {
                 description = validationRuleGroup.getDescription();
             }
-            else if ( MergeStrategy.MERGE_IF_NOT_NULL.equals( strategy ) )
+            else if ( strategy.isMerge() )
             {
                 description = validationRuleGroup.getDescription() == null ? description : validationRuleGroup.getDescription();
             }