You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by si...@apache.org on 2019/06/19 14:53:58 UTC
[sling-whiteboard] 03/06: [featire-diff] updated documentation
This is an automated email from the ASF dual-hosted git repository.
simonetripodi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
commit b49b3e270098a19a4bee1071c97b2b5cee0979e8
Author: Simo Tripodi <st...@adobe.com>
AuthorDate: Wed Jun 19 14:54:48 2019 +0200
[featire-diff] updated documentation
---
feature-diff/README.md | 6 +++---
.../sling/feature/diff/spi/FeatureElementComparator.java | 16 ++++++++++++++++
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/feature-diff/README.md b/feature-diff/README.md
index 69b8d47..7213b28 100644
--- a/feature-diff/README.md
+++ b/feature-diff/README.md
@@ -13,14 +13,14 @@ import static org.apache.sling.feature.diff.FeatureDiff.compareFeatures;
import org.apache.sling.feature.Feature
import org.apache.sling.feature.diff.DiffRequest;
-import org.apache.sling.feature.diff.DefaultDiffRequest;
+import org.apache.sling.feature.diff.DiffRequest;
...
Feature previous = // somehow obtained
Feature current = // somehow obtained
-DiffRequest diffRequest = new DefaultDiffRequest()
+DiffRequest diffRequest = new DiffRequest()
.setPrevious(previous)
.setCurrent(current)
.setResultId("org.apache.sling:org.apache.sling.diff:1.0.0");
@@ -49,7 +49,7 @@ The `DiffRequest` data object can be configured in order to include/exclude one
Users can simply add via the include/exclude methods the section(s) they are interested:
```
-DiffRequest diffRequest = new DefaultDiffRequest()
+DiffRequest diffRequest = new DiffRequest()
.setPrevious(previous)
.setCurrent(current)
.addIncludeComparator("bundles")
diff --git a/feature-diff/src/main/java/org/apache/sling/feature/diff/spi/FeatureElementComparator.java b/feature-diff/src/main/java/org/apache/sling/feature/diff/spi/FeatureElementComparator.java
index 7c697f4..536c775 100644
--- a/feature-diff/src/main/java/org/apache/sling/feature/diff/spi/FeatureElementComparator.java
+++ b/feature-diff/src/main/java/org/apache/sling/feature/diff/spi/FeatureElementComparator.java
@@ -18,10 +18,26 @@ package org.apache.sling.feature.diff.spi;
import org.apache.sling.feature.Feature;
+/**
+ * A simple service to compare a specific Feature section.
+ */
public interface FeatureElementComparator {
+ /**
+ * Returns a short id which identifies the Feature section for which differences will be computed.
+ *
+ * @return a short id which identifies the Feature section for which differences will be computed.
+ */
String getId();
+ /**
+ * Compares a specific Feature sections between the previous and the current,
+ * reporting additions/updates/removals in the target.
+ *
+ * @param previous
+ * @param current
+ * @param target
+ */
public void computeDiff(Feature previous, Feature current, Feature target);
}