Skip to content
Snippets Groups Projects
Unverified Commit aac15864 authored by Martin Lowe's avatar Martin Lowe :flag_ca: Committed by GitHub
Browse files

Merge pull request #34 from autumnfound/malowe/master/28

Add maintainers to Listing #28
parents bd2e0d91 2c3273e8
No related branches found
No related tags found
No related merge requests found
...@@ -63,7 +63,6 @@ public class Listing extends NodeBase { ...@@ -63,7 +63,6 @@ public class Listing extends NodeBase {
private List<Author> authors; private List<Author> authors;
private List<Tag> tags; private List<Tag> tags;
private List<SolutionVersion> versions; private List<SolutionVersion> versions;
private String maintainers;
/** /**
* Default constructor, sets lists to empty lists to stop null pointers * Default constructor, sets lists to empty lists to stop null pointers
...@@ -74,7 +73,6 @@ public class Listing extends NodeBase { ...@@ -74,7 +73,6 @@ public class Listing extends NodeBase {
this.versions = new ArrayList<>(); this.versions = new ArrayList<>();
this.categoryIds = new ArrayList<>(); this.categoryIds = new ArrayList<>();
this.categories = new ArrayList<>(); this.categories = new ArrayList<>();
} }
/** /**
...@@ -349,27 +347,13 @@ public class Listing extends NodeBase { ...@@ -349,27 +347,13 @@ public class Listing extends NodeBase {
this.versions = new ArrayList<>(versions); this.versions = new ArrayList<>(versions);
} }
* @return the maintainers
*/
public String getMaintainers() {
return maintainers;
}
/**
* @param maintainers the maintainers to set
*/
public void setMaintainers(String maintainers) {
this.maintainers = maintainers;
}
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;
int result = super.hashCode(); int result = super.hashCode();
result = prime * result + Objects.hash(authors, body, categories, categoryIds, creationDate, favoriteCount, result = prime * result + Objects.hash(authors, body, categories, categoryIds, creationDate, favoriteCount,
foundationMember, homepageUrl, installsRecent, installsTotal, license, logo, organization, status, foundationMember, homepageUrl, installsRecent, installsTotal, license, logo, organization, status,
supportUrl, tags, teaser, updateDate, versions, maintainers); supportUrl, tags, teaser, updateDate, versions);
return result; return result;
} }
...@@ -391,16 +375,15 @@ public class Listing extends NodeBase { ...@@ -391,16 +375,15 @@ public class Listing extends NodeBase {
&& foundationMember == other.foundationMember && Objects.equals(homepageUrl, other.homepageUrl) && foundationMember == other.foundationMember && Objects.equals(homepageUrl, other.homepageUrl)
&& installsRecent == other.installsRecent && installsTotal == other.installsTotal && installsRecent == other.installsRecent && installsTotal == other.installsTotal
&& Objects.equals(logo, other.logo) && Objects.equals(organization, other.organization) && Objects.equals(logo, other.logo) && Objects.equals(organization, other.organization)
&& Objects.equals(organizations, other.organizations) && Objects.equals(status, other.status) && Objects.equals(status, other.status) && Objects.equals(supportUrl, other.supportUrl)
&& Objects.equals(supportUrl, other.supportUrl) && Objects.equals(tags, other.tags) && Objects.equals(tags, other.tags) && Objects.equals(teaser, other.teaser)
&& Objects.equals(teaser, other.teaser) && updateDate == other.updateDate && updateDate == other.updateDate && Objects.equals(versions, other.versions);
&& Objects.equals(url, other.url) && Objects.equals(versions, other.versions);
&& Objects.equals(maintainers, other.maintainers);
} }
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("Listing [");
sb.append(", id=").append(getId()); sb.append(", id=").append(getId());
sb.append(", name=").append(getName()); sb.append(", name=").append(getName());
sb.append(", url=").append(getUrl()); sb.append(", url=").append(getUrl());
...@@ -421,7 +404,7 @@ public class Listing extends NodeBase { ...@@ -421,7 +404,7 @@ public class Listing extends NodeBase {
sb.append(", authors=").append(authors); sb.append(", authors=").append(authors);
sb.append(", tags=").append(tags); sb.append(", tags=").append(tags);
sb.append(", versions=").append(versions); sb.append(", versions=").append(versions);
sb.append(", maintainers=").append(maintainers); sb.append(']');
return sb.toString(); return sb.toString();
} }
} }
\ No newline at end of file
...@@ -80,7 +80,6 @@ public class ListingCodec implements CollectibleCodec<Listing> { ...@@ -80,7 +80,6 @@ public class ListingCodec implements CollectibleCodec<Listing> {
doc.put(DatabaseFieldNames.CREATION_DATE, new Date(value.getCreationDate())); doc.put(DatabaseFieldNames.CREATION_DATE, new Date(value.getCreationDate()));
doc.put(DatabaseFieldNames.FOUNDATION_MEMBER_FLAG, value.isFoundationMember()); doc.put(DatabaseFieldNames.FOUNDATION_MEMBER_FLAG, value.isFoundationMember());
doc.put(DatabaseFieldNames.CATEGORY_IDS, value.getCategoryIds()); doc.put(DatabaseFieldNames.CATEGORY_IDS, value.getCategoryIds());
doc.put(DatabaseFieldNames.MAINTAINERS, value.getMaintainers());
// for nested document types, use the converters to safely transform into BSON // for nested document types, use the converters to safely transform into BSON
// documents // documents
...@@ -119,7 +118,6 @@ public class ListingCodec implements CollectibleCodec<Listing> { ...@@ -119,7 +118,6 @@ public class ListingCodec implements CollectibleCodec<Listing> {
out.setFavoriteCount(document.getLong(DatabaseFieldNames.MARKETPLACE_FAVORITES)); out.setFavoriteCount(document.getLong(DatabaseFieldNames.MARKETPLACE_FAVORITES));
out.setFoundationMember(document.getBoolean(DatabaseFieldNames.FOUNDATION_MEMBER_FLAG)); out.setFoundationMember(document.getBoolean(DatabaseFieldNames.FOUNDATION_MEMBER_FLAG));
out.setCategoryIds(document.getList(DatabaseFieldNames.CATEGORY_IDS, String.class)); out.setCategoryIds(document.getList(DatabaseFieldNames.CATEGORY_IDS, String.class));
out.setMaintainers(document.getString(DatabaseFieldNames.MAINTAINERS));
// for nested document types, use the converters to safely transform into POJO // for nested document types, use the converters to safely transform into POJO
out.setAuthors(document.getList(DatabaseFieldNames.LISTING_AUTHORS, Document.class).stream() out.setAuthors(document.getList(DatabaseFieldNames.LISTING_AUTHORS, Document.class).stream()
......
...@@ -124,7 +124,6 @@ function generateJSON(id) { ...@@ -124,7 +124,6 @@ function generateJSON(id) {
} }
], ],
"versions": solutions, "versions": solutions,
"maintainers": "Bill and Ted",
"category_ids": splice(categoryIds).splice(0,Math.ceil(Math.random()*5)+1) "category_ids": splice(categoryIds).splice(0,Math.ceil(Math.random()*5)+1)
}; };
} }
......
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