/** * Copies a map of {@link SiteLink} objects. * * @param siteLinks * object to copy * @return the copied object */ private Map<String, SiteLink> copySiteLinks(Map<String, SiteLink> siteLinks) { if (filter.excludeAllSiteLinks()) { return Collections.emptyMap(); } Map<String, SiteLink> result = new HashMap<>(siteLinks.size()); for (Entry<String, SiteLink> entry : siteLinks.entrySet()) { if (filter.includeSiteLink(entry.getKey())) { result.put(entry.getKey(), copy(entry.getValue())); } } return result; }
/** * Copies a map of {@link SiteLink} objects. * * @param siteLinks * object to copy * @return the copied object */ private Map<String, SiteLink> copySiteLinks(Map<String, SiteLink> siteLinks) { if (filter.excludeAllSiteLinks()) { return Collections.emptyMap(); } Map<String, SiteLink> result = new HashMap<>(siteLinks.size()); for (Entry<String, SiteLink> entry : siteLinks.entrySet()) { if (filter.includeSiteLink(entry.getKey())) { result.put(entry.getKey(), copy(entry.getValue())); } } return result; }
/** * Sets the value for the API's "props" parameter based on the current * settings. * * @param properties * current setting of parameters */ private void setRequestProps(WbGetEntitiesActionData properties) { StringBuilder builder = new StringBuilder(); builder.append("info|datatype"); if (!this.filter.excludeAllLanguages()) { builder.append("|labels|aliases|descriptions"); } if (!this.filter.excludeAllProperties()) { builder.append("|claims"); } if (!this.filter.excludeAllSiteLinks()) { builder.append("|sitelinks"); } properties.props = builder.toString(); }
/** * Sets the value for the API's "props" parameter based on the current * settings. * * @param properties * current setting of parameters */ private void setRequestProps(WbGetEntitiesActionData properties) { StringBuilder builder = new StringBuilder(); builder.append("info|datatype"); if (!this.filter.excludeAllLanguages()) { builder.append("|labels|aliases|descriptions"); } if (!this.filter.excludeAllProperties()) { builder.append("|claims"); } if (!this.filter.excludeAllSiteLinks()) { builder.append("|sitelinks"); } properties.props = builder.toString(); }
/** * Sets the value for the API's "sitefilter" parameter based on the current * settings. * * @param properties * current setting of parameters */ private void setRequestSitefilter(WbGetEntitiesActionData properties) { if (this.filter.excludeAllSiteLinks() || this.filter.getSiteLinkFilter() == null) { return; } properties.sitefilter = ApiConnection.implodeObjects(this.filter .getSiteLinkFilter()); }
/** * Sets the value for the API's "sitefilter" parameter based on the current * settings. * * @param properties * current setting of parameters */ private void setRequestSitefilter(WbGetEntitiesActionData properties) { if (this.filter.excludeAllSiteLinks() || this.filter.getSiteLinkFilter() == null) { return; } properties.sitefilter = ApiConnection.implodeObjects(this.filter .getSiteLinkFilter()); }
dataFetcher.getFilter().excludeAllSiteLinks();
dataFetcher.getFilter().excludeAllSiteLinks();