Skip to content
Snippets Groups Projects
Commit 8641cc63 authored by Martin Lowe's avatar Martin Lowe :flag_ca: Committed by Christopher Guindon
Browse files

Rename 'name' in BaseNode to 'title' #38


Renamed name to title, updated database fields to match.

Change-Id: I2fefc1b6426644a57b902c4a29d893dc1704c049
Signed-off-by: Martin Lowe's avatarMartin Lowe <martin.lowe@eclipse-foundation.org>
parent c5db9019
No related branches found
No related tags found
No related merge requests found
......@@ -385,7 +385,7 @@ public class Listing extends NodeBase {
StringBuilder sb = new StringBuilder();
sb.append("Listing [");
sb.append(", id=").append(getId());
sb.append(", name=").append(getName());
sb.append(", name=").append(getTitle());
sb.append(", url=").append(getUrl());
sb.append(", supportUrl=").append(supportUrl);
sb.append(", homepageUrl=").append(homepageUrl);
......
......@@ -15,7 +15,7 @@ import java.util.Objects;
*/
public class NodeBase {
private String id;
private String name;
private String title;
private String url;
/**
......@@ -33,17 +33,17 @@ public class NodeBase {
}
/**
* @return the name
* @return the title
*/
public String getName() {
return name;
public String getTitle() {
return title;
}
/**
* @param name the name to set
* @param title the title to set
*/
public void setName(String name) {
this.name = name;
public void setTitle(String title) {
this.title = title;
}
/**
......@@ -62,7 +62,7 @@ public class NodeBase {
@Override
public int hashCode() {
return Objects.hash(id, name, url);
return Objects.hash(id, title, url);
}
@Override
......@@ -77,6 +77,6 @@ public class NodeBase {
return false;
}
NodeBase other = (NodeBase) obj;
return Objects.equals(id, other.id) && Objects.equals(name, other.name) && Objects.equals(url, other.url);
return Objects.equals(id, other.id) && Objects.equals(title, other.title) && Objects.equals(url, other.url);
}
}
......@@ -51,7 +51,7 @@ public class CatalogCodec implements CollectibleCodec<Catalog> {
Document doc = new Document();
doc.put(DatabaseFieldNames.DOCID, value.getId());
doc.put(DatabaseFieldNames.NAME, value.getName());
doc.put(DatabaseFieldNames.TITLE, value.getTitle());
doc.put(DatabaseFieldNames.URL, value.getUrl());
doc.put(DatabaseFieldNames.CATALOG_ICON, value.getIcon());
doc.put(DatabaseFieldNames.CATALOG_SELF_CONTAINED, value.isSelfContained());
......@@ -73,7 +73,7 @@ public class CatalogCodec implements CollectibleCodec<Catalog> {
Catalog out = new Catalog();
out.setId(document.getString(DatabaseFieldNames.DOCID));
out.setUrl(document.getString(DatabaseFieldNames.URL));
out.setName(document.getString(DatabaseFieldNames.NAME));
out.setTitle(document.getString(DatabaseFieldNames.TITLE));
out.setIcon(document.getString(DatabaseFieldNames.CATALOG_ICON));
out.setSelfContained(document.getBoolean(DatabaseFieldNames.CATALOG_SELF_CONTAINED));
out.setSearchEnabled(document.getBoolean(DatabaseFieldNames.CATALOG_SEARCH_ENABLED));
......
......@@ -43,7 +43,7 @@ public class ErrorReportCodec implements CollectibleCodec<ErrorReport> {
Document doc = new Document();
doc.put(DatabaseFieldNames.DOCID, value.getId());
doc.put(DatabaseFieldNames.NAME, value.getTitle());
doc.put(DatabaseFieldNames.TITLE, value.getTitle());
doc.put(DatabaseFieldNames.ERROR_BODY, value.getBody());
doc.put(DatabaseFieldNames.ERROR_DETAILED_MESSAGE, value.getDetailedMessage());
doc.put(DatabaseFieldNames.ERROR_READ, value.isRead());
......
......@@ -65,7 +65,7 @@ public class ListingCodec implements CollectibleCodec<Listing> {
// for each of the fields, get the value from the unencoded object and set it
doc.put(DatabaseFieldNames.DOCID, value.getId());
doc.put(DatabaseFieldNames.NAME, value.getName());
doc.put(DatabaseFieldNames.TITLE, value.getTitle());
doc.put(DatabaseFieldNames.URL, value.getUrl());
doc.put(DatabaseFieldNames.SUPPORT_PAGE_URL, value.getSupportUrl());
doc.put(DatabaseFieldNames.HOME_PAGE_URL, value.getHomepageUrl());
......@@ -105,7 +105,7 @@ public class ListingCodec implements CollectibleCodec<Listing> {
// for each field, get the value from the encoded object and set it in POJO
out.setId(document.getString(DatabaseFieldNames.DOCID));
out.setName(document.getString(DatabaseFieldNames.NAME));
out.setTitle(document.getString(DatabaseFieldNames.TITLE));
out.setUrl(document.getString(DatabaseFieldNames.URL));
out.setSupportUrl(document.getString(DatabaseFieldNames.SUPPORT_PAGE_URL));
out.setHomepageUrl(document.getString(DatabaseFieldNames.HOME_PAGE_URL));
......
......@@ -47,7 +47,7 @@ public class MarketCodec implements CollectibleCodec<Market> {
doc.put(DatabaseFieldNames.DOCID, value.getId());
doc.put(DatabaseFieldNames.URL, value.getUrl());
doc.put(DatabaseFieldNames.NAME, value.getName());
doc.put(DatabaseFieldNames.TITLE, value.getTitle());
doc.put(DatabaseFieldNames.CATEGORY_IDS, value.getCategoryIds());
documentCodec.encode(writer, doc, encoderContext);
......@@ -64,7 +64,7 @@ public class MarketCodec implements CollectibleCodec<Market> {
Market out = new Market();
out.setId(document.getString(DatabaseFieldNames.DOCID));
out.setUrl(document.getString(DatabaseFieldNames.URL));
out.setName(document.getString(DatabaseFieldNames.NAME));
out.setTitle(document.getString(DatabaseFieldNames.TITLE));
return out;
}
......
......@@ -21,7 +21,7 @@ public class CategoryConverter implements Converter<Category> {
public Category convert(Document src) {
Category out = new Category();
out.setId(src.getString(DatabaseFieldNames.DOCID));
out.setName(src.getString(DatabaseFieldNames.NAME));
out.setTitle(src.getString(DatabaseFieldNames.TITLE));
out.setUrl(src.getString(DatabaseFieldNames.URL));
return out;
}
......@@ -30,7 +30,7 @@ public class CategoryConverter implements Converter<Category> {
public Document convert(Category src) {
Document doc = new Document();
doc.put(DatabaseFieldNames.DOCID, src.getId());
doc.put(DatabaseFieldNames.NAME, src.getName());
doc.put(DatabaseFieldNames.TITLE, src.getTitle());
doc.put(DatabaseFieldNames.URL, src.getUrl());
return doc;
}
......
......@@ -20,7 +20,7 @@ public final class DatabaseFieldNames {
// base fields
public static final String DOCID = "_id";
public static final String URL = "url";
public static final String NAME = "name";
public static final String TITLE = "title";
public static final String OS = "os";
public static final String LISTING_ID = "listing_id";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment