@Test public void testEmptyLanguageFilterForItem() { DocumentDataFilter documentDataFilter = new DocumentDataFilter(); documentDataFilter.setLanguageFilter(Collections.emptySet()); DatamodelFilter filter = new DatamodelFilter(new DataObjectFactoryImpl(), documentDataFilter); ItemDocument itemDocument = Datamodel.makeItemDocument( Datamodel.makeWikidataItemIdValue("Q42"), Arrays.asList( Datamodel.makeMonolingualTextValue("Label de", "de"), Datamodel.makeMonolingualTextValue("Label en", "en"), Datamodel.makeMonolingualTextValue("Label he", "he") ), Arrays.asList( Datamodel.makeMonolingualTextValue("Desc en", "en"), Datamodel.makeMonolingualTextValue("Desc he", "he") ), Arrays.asList( Datamodel.makeMonolingualTextValue("Alias en", "en"), Datamodel.makeMonolingualTextValue("Alias de1", "de"), Datamodel.makeMonolingualTextValue("Alias de2", "de") ), Collections.emptyList(), Collections.emptyMap() ); ItemDocument itemDocumentFiltered = Datamodel.makeItemDocument(Datamodel.makeWikidataItemIdValue("Q42"), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyMap() ); assertEquals(itemDocumentFiltered, filter.filter(itemDocument)); }
public ItemDocument filter(ItemDocument item) { return dataObjectFactory.getItemDocument( item.getEntityId(), filterMonoLingualTextValues(item.getLabels().values()), filterMonoLingualTextValues(item.getDescriptions().values()), filterMonoLingualTextValues(flatten(item.getAliases().values())), filterStatementGroups(item.getStatementGroups()), filterSiteLinks(item.getSiteLinks()), item.getRevisionId() ); }
DatamodelFilter { public ItemDocument filter(ItemDocument item) { return dataObjectFactory.getItemDocument( item.getEntityId(), filterMonoLingualTextValues(item.getLabels().values()), filterMonoLingualTextValues(item.getDescriptions().values()), filterMonoLingualTextValues(flatten(item.getAliases().values())), filterStatementGroups(item.getStatementGroups()), filterSiteLinks(item.getSiteLinks()), item.getRevisionId() ); } }
DatamodelFilter { public ItemDocument filter(ItemDocument item) { return dataObjectFactory.getItemDocument( item.getEntityId(), filterMonoLingualTextValues(item.getLabels().values()), filterMonoLingualTextValues(item.getDescriptions().values()), filterMonoLingualTextValues(flatten(item.getAliases().values())), filterStatementGroups(item.getStatementGroups()), filterSiteLinks(item.getSiteLinks()), item.getRevisionId() ); } DatamodelFilter(DataObjectFactory dataObjectFactory, DocumentDataFilter filter); }
DatamodelFilter { public ItemDocument filter(ItemDocument item) { return dataObjectFactory.getItemDocument( item.getEntityId(), filterMonoLingualTextValues(item.getLabels().values()), filterMonoLingualTextValues(item.getDescriptions().values()), filterMonoLingualTextValues(flatten(item.getAliases().values())), filterStatementGroups(item.getStatementGroups()), filterSiteLinks(item.getSiteLinks()), item.getRevisionId() ); } DatamodelFilter(DataObjectFactory dataObjectFactory, DocumentDataFilter filter); ItemDocument filter(ItemDocument item); PropertyDocument filter(PropertyDocument property); MediaInfoDocument filter(MediaInfoDocument mediaInfo); LexemeDocument filter(LexemeDocument lexeme); FormDocument filter(FormDocument form); SenseDocument filter(SenseDocument sense); }
DatamodelFilter { public ItemDocument filter(ItemDocument item) { return dataObjectFactory.getItemDocument( item.getEntityId(), filterMonoLingualTextValues(item.getLabels().values()), filterMonoLingualTextValues(item.getDescriptions().values()), filterMonoLingualTextValues(flatten(item.getAliases().values())), filterStatementGroups(item.getStatementGroups()), filterSiteLinks(item.getSiteLinks()), item.getRevisionId() ); } DatamodelFilter(DataObjectFactory dataObjectFactory, DocumentDataFilter filter); ItemDocument filter(ItemDocument item); PropertyDocument filter(PropertyDocument property); MediaInfoDocument filter(MediaInfoDocument mediaInfo); LexemeDocument filter(LexemeDocument lexeme); FormDocument filter(FormDocument form); SenseDocument filter(SenseDocument sense);  }