This is an automated email from the ASF dual-hosted git repository.
davidb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
The following commit(s) were added to refs/heads/master by this push:
new ff42199 Change Feature Title to Feature Name
ff42199 is described below
commit ff42199e5d8d737314b6b36edcc25b93c754646e
Author: David Bosschaert <[email protected]>
AuthorDate: Fri Jun 26 16:40:14 2020 +0100
Change Feature Title to Feature Name
---
.../main/java/org/osgi/util/features/Feature.java | 6 ++---
.../org/osgi/util/features/FeatureBuilder.java | 6 ++---
.../util/features/impl/FeatureBuilderImpl.java | 28 +++++++++++-----------
.../util/features/impl/FeatureServiceImpl.java | 6 ++---
.../util/features/impl/FeatureServiceImplTest.java | 2 +-
5 files changed, 24 insertions(+), 24 deletions(-)
diff --git
a/osgi-featuremodel/src/main/java/org/osgi/util/features/Feature.java
b/osgi-featuremodel/src/main/java/org/osgi/util/features/Feature.java
index 498abba..ab3d314 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/util/features/Feature.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/util/features/Feature.java
@@ -25,10 +25,10 @@ import java.util.Map;
*/
public interface Feature extends FeatureArtifact {
/**
- * Get the title.
- * @return The title.
+ * Get the name.
+ * @return The name.
*/
- String getTitle();
+ String getName();
/**
* Get the description.
diff --git
a/osgi-featuremodel/src/main/java/org/osgi/util/features/FeatureBuilder.java
b/osgi-featuremodel/src/main/java/org/osgi/util/features/FeatureBuilder.java
index b01db04..afa8fc5 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/util/features/FeatureBuilder.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/util/features/FeatureBuilder.java
@@ -25,11 +25,11 @@ import java.util.Map;
public interface FeatureBuilder {
/**
- * Set the Feature Title.
- * @param title The Title.
+ * Set the Feature Name.
+ * @param name The Name.
* @return This builder.
*/
- FeatureBuilder setTitle(String title); // TODO do we need this one?
+ FeatureBuilder setName(String name);
/**
* Set the Vendor.
diff --git
a/osgi-featuremodel/src/main/java/org/osgi/util/features/impl/FeatureBuilderImpl.java
b/osgi-featuremodel/src/main/java/org/osgi/util/features/impl/FeatureBuilderImpl.java
index 4fa3eee..d120b29 100644
---
a/osgi-featuremodel/src/main/java/org/osgi/util/features/impl/FeatureBuilderImpl.java
+++
b/osgi-featuremodel/src/main/java/org/osgi/util/features/impl/FeatureBuilderImpl.java
@@ -16,12 +16,12 @@
*/
package org.osgi.util.features.impl;
-import org.osgi.util.features.ID;
+import org.osgi.util.features.Feature;
+import org.osgi.util.features.FeatureBuilder;
import org.osgi.util.features.FeatureBundle;
import org.osgi.util.features.FeatureConfiguration;
import org.osgi.util.features.FeatureExtension;
-import org.osgi.util.features.Feature;
-import org.osgi.util.features.FeatureBuilder;
+import org.osgi.util.features.ID;
import java.util.ArrayList;
import java.util.Arrays;
@@ -34,7 +34,7 @@ import java.util.Objects;
class FeatureBuilderImpl implements FeatureBuilder {
private final ID id;
- private String title;
+ private String name;
private String description;
private String vendor;
private String license;
@@ -52,8 +52,8 @@ class FeatureBuilderImpl implements FeatureBuilder {
}
@Override
- public FeatureBuilder setTitle(String title) {
- this.title = title;
+ public FeatureBuilder setName(String name) {
+ this.name = name;
return this;
}
@@ -129,13 +129,13 @@ class FeatureBuilderImpl implements FeatureBuilder {
@Override
public Feature build() {
- return new FeatureImpl(id, title,
+ return new FeatureImpl(id, name,
description, vendor, license, location, complete, isFinal,
bundles, configurations, extensions, variables);
}
private static class FeatureImpl extends ArtifactImpl implements Feature {
- private final String title;
+ private final String name;
private final String description;
private final String vendor;
private final String license;
@@ -148,12 +148,12 @@ class FeatureBuilderImpl implements FeatureBuilder {
private final Map<String,FeatureExtension> extensions;
private final Map<String,String> variables;
- private FeatureImpl(ID id, String aTitle, String desc, String vnd,
String lic, String loc,
+ private FeatureImpl(ID id, String aName, String desc, String vnd,
String lic, String loc,
boolean comp, boolean fin, List<FeatureBundle> bs,
Map<String,FeatureConfiguration> cs,
Map<String,FeatureExtension> es, Map<String,String> vars) {
super(id);
- title = aTitle;
+ name = aName;
description = desc;
vendor = vnd;
license = lic;
@@ -168,8 +168,8 @@ class FeatureBuilderImpl implements FeatureBuilder {
}
@Override
- public String getTitle() {
- return title;
+ public String getName() {
+ return name;
}
@Override
@@ -227,7 +227,7 @@ class FeatureBuilderImpl implements FeatureBuilder {
final int prime = 31;
int result = super.hashCode();
result = prime * result + Objects.hash(bundles, complete,
configurations, description, isFinal, license, location,
- title, variables, vendor);
+ name, variables, vendor);
return result;
}
@@ -243,7 +243,7 @@ class FeatureBuilderImpl implements FeatureBuilder {
return Objects.equals(bundles, other.bundles) && complete ==
other.complete
&& Objects.equals(configurations, other.configurations) &&
Objects.equals(description, other.description)
&& isFinal == other.isFinal && Objects.equals(license,
other.license)
- && Objects.equals(location, other.location) &&
Objects.equals(title, other.title)
+ && Objects.equals(location, other.location) &&
Objects.equals(name, other.name)
&& Objects.equals(variables, other.variables) &&
Objects.equals(vendor, other.vendor);
}
diff --git
a/osgi-featuremodel/src/main/java/org/osgi/util/features/impl/FeatureServiceImpl.java
b/osgi-featuremodel/src/main/java/org/osgi/util/features/impl/FeatureServiceImpl.java
index 8aa6b48..63d1292 100644
---
a/osgi-featuremodel/src/main/java/org/osgi/util/features/impl/FeatureServiceImpl.java
+++
b/osgi-featuremodel/src/main/java/org/osgi/util/features/impl/FeatureServiceImpl.java
@@ -57,7 +57,7 @@ public class FeatureServiceImpl { //implements FeatureService
{
String id = json.getString("id");
FeatureBuilder builder =
builderFactory.newFeatureBuilder(ID.fromMavenID(id));
- builder.setTitle(json.getString("title", null));
+ builder.setName(json.getString("title", null));
builder.setDescription(json.getString("description", null));
builder.setVendor(json.getString("vendor", null));
builder.setLicense(json.getString("license", null));
@@ -310,8 +310,8 @@ public class FeatureServiceImpl { //implements
FeatureService {
}
private void copyAttrs(Feature f, FeatureBuilder fb) {
- if (f.getTitle() != null)
- fb.setTitle(f.getTitle());
+ if (f.getName() != null)
+ fb.setName(f.getName());
if (f.getDescription() != null)
fb.setDescription(f.getDescription());
diff --git
a/osgi-featuremodel/src/test/java/org/osgi/util/features/impl/FeatureServiceImplTest.java
b/osgi-featuremodel/src/test/java/org/osgi/util/features/impl/FeatureServiceImplTest.java
index 14fcf05..0cc83c0 100644
---
a/osgi-featuremodel/src/test/java/org/osgi/util/features/impl/FeatureServiceImplTest.java
+++
b/osgi-featuremodel/src/test/java/org/osgi/util/features/impl/FeatureServiceImplTest.java
@@ -49,7 +49,7 @@ public class FeatureServiceImplTest {
try (Reader r = new InputStreamReader(res.openStream())) {
Feature f = Features.readFeature(r);
- assertNull(f.getTitle());
+ assertNull(f.getName());
assertEquals("The feature description", f.getDescription());
List<FeatureBundle> bundles = f.getBundles();