/** * 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(); }
/** * Copies a collection of {@link MonolingualTextValue} objects * * @param monoLingualTextValues * object to copy * @return the copied object */ private List<MonolingualTextValue> copyMonoLingualTextValues(Collection<MonolingualTextValue> monoLingualTextValues) { if (filter.excludeAllLanguages()) { return Collections.emptyList(); } List<MonolingualTextValue> result = new ArrayList<>(monoLingualTextValues.size()); for (MonolingualTextValue mtv : monoLingualTextValues) { if (filter.includeLanguage(mtv.getLanguageCode())) { result.add(copy(mtv)); } } return result; }
/** * Copies a collection of {@link MonolingualTextValue} objects * * @param monoLingualTextValues * object to copy * @return the copied object */ private List<MonolingualTextValue> copyMonoLingualTextValues(Collection<MonolingualTextValue> monoLingualTextValues) { if (filter.excludeAllLanguages()) { return Collections.emptyList(); } List<MonolingualTextValue> result = new ArrayList<>(monoLingualTextValues.size()); for (MonolingualTextValue mtv : monoLingualTextValues) { if (filter.includeLanguage(mtv.getLanguageCode())) { result.add(copy(mtv)); } } return result; }
/** * Sets the value for the API's "languages" parameter based on the current * settings. * * @param properties * current setting of parameters */ private void setRequestLanguages(WbGetEntitiesActionData properties) { if (this.filter.excludeAllLanguages() || this.filter.getLanguageFilter() == null) { return; } properties.languages = ApiConnection.implodeObjects(this.filter .getLanguageFilter()); }
/** * Sets the value for the API's "languages" parameter based on the current * settings. * * @param properties * current setting of parameters */ private void setRequestLanguages(WbGetEntitiesActionData properties) { if (this.filter.excludeAllLanguages() || this.filter.getLanguageFilter() == null) { return; } properties.languages = ApiConnection.implodeObjects(this.filter .getLanguageFilter()); }
Datamodel.SITE_WIKIDATA); dataFetcher.getFilter().excludeAllLanguages(); dataFetcher.getFilter().excludeAllSiteLinks();
Datamodel.SITE_WIKIDATA); dataFetcher.getFilter().excludeAllLanguages(); dataFetcher.getFilter().excludeAllSiteLinks();