public static IndexedTypeSet composite(final IndexedTypeSet set, final IndexedTypeIdentifier additionalId) { return composite( set, additionalId.asTypeSet() ); }
private static IndexedTypeSet fromSafeHashSet(HashSet<IndexedTypeIdentifier> set) { if ( set.isEmpty() ) { return empty(); } else if ( set.size() == 1 ) { return set.iterator().next().asTypeSet(); } else { return new HashSetIndexedTypeSet( set ); } }
private static IndexedTypeSet fromSafeHashSet(HashSet<IndexedTypeIdentifier> set) { if ( set.isEmpty() ) { return empty(); } else if ( set.size() == 1 ) { return set.iterator().next().asTypeSet(); } else { return new HashSetIndexedTypeSet( set ); } }
public static IndexedTypeSet fromIdentifiers(IndexedTypeIdentifier... types) { if ( types == null || types.length == 0 ) { // "null" needs to be acceptable to support some legacy use cases return empty(); } else if ( types.length == 1 ) { return types[0].asTypeSet(); } else { return Arrays.stream( types ).collect( streamCollector() ); } }
public static IndexedTypeSet fromIdentifiers(IndexedTypeIdentifier... types) { if ( types == null || types.length == 0 ) { // "null" needs to be acceptable to support some legacy use cases return empty(); } else if ( types.length == 1 ) { return types[0].asTypeSet(); } else { return Arrays.stream( types ).collect( streamCollector() ); } }
public static boolean isMappedToElasticsearch(ExtendedSearchIntegrator integrator, IndexedTypeIdentifier entityType) { IndexedTypeSet entityTypesWithSubTypes = integrator.getIndexedTypesPolymorphic( entityType.asTypeSet() ); return hasElasticsearchIndexManager( integrator, entityTypesWithSubTypes ); }
public static boolean isMappedToElasticsearch(ExtendedSearchIntegrator integrator, IndexedTypeIdentifier entityType) { IndexedTypeSet entityTypesWithSubTypes = integrator.getIndexedTypesPolymorphic( entityType.asTypeSet() ); return hasElasticsearchIndexManager( integrator, entityTypesWithSubTypes ); }
public void flush(IndexedTypeIdentifier entity) { LOG.flushingIndex(entity.getName()); defaultBatchBackend.flush(entity.asTypeSet()); }
public void flush(IndexedTypeIdentifier entity) { LOG.flushingIndex(entity.getName()); defaultBatchBackend.flush(entity.asTypeSet()); }
public void purge(IndexedTypeIdentifier entity) { LOG.purgingIndex(entity.getName()); defaultBatchBackend.purge(entity.asTypeSet()); }
public void purge(IndexedTypeIdentifier entity) { LOG.purgingIndex(entity.getName()); defaultBatchBackend.purge(entity.asTypeSet()); }
private DocumentBuilderIndexedEntity getDocumentBuilder(IndexedTypeIdentifier entityType, ExtendedSearchIntegrator extendedIntegrator) { IndexedTypeSet indexedEntities = extendedIntegrator.getIndexedTypesPolymorphic( entityType.asTypeSet() ); if ( indexedEntities.size() > 0 ) { return extendedIntegrator.getIndexBinding( indexedEntities.iterator().next() ).getDocumentBuilder(); } else { return null; } }
@Test public void subtractionOfOneFromCouple() { assertIsSingletonSet( IndexedTypeSets.subtraction( IndexedTypeSets.composite( TYPE_A.asTypeSet(), TYPE_B ), TYPE_B.asTypeSet() ), TYPE_A.getPojoType(), true ); assertIsSingletonSet( IndexedTypeSets.subtraction( IndexedTypeSets.composite( TYPE_A.asTypeSet(), TYPE_B ), TYPE_A.asTypeSet() ), TYPE_B.getPojoType(), true ); }
@Test public void compositeSingle() { assertIsSingletonSet( IndexedTypeSets.composite( TYPE_A.asTypeSet(), TYPE_A ), BasicTypeCollectionsTest.class, true ); }
@Test public void buildCoupleSet() { assertIsDoubleSet( IndexedTypeSets.composite( TYPE_A.asTypeSet(), TYPE_B ) ); }
@Test public void singleElementIterable() { assertIsSingletonSet( IndexedTypeSets.fromIdentifiers( TYPE_A.asTypeSet() ), BasicTypeCollectionsTest.class, true ); }
@Test public void subtractionOfEmptyFromSingleton() { assertIsSingletonSet( IndexedTypeSets.subtraction( TYPE_A.asTypeSet(), IndexedTypeSets.empty() ), BasicTypeCollectionsTest.class, true ); }
@Test public void compositeSingleAndEmpty() { assertIsSingletonSet( IndexedTypeSets.composite( TYPE_A.asTypeSet(), IndexedTypeSets.empty() ), BasicTypeCollectionsTest.class, true ); }
@Test public void subtractionOfSingletonFromEmpty() { assertIsEmpty( IndexedTypeSets.subtraction( IndexedTypeSets.empty(), TYPE_A.asTypeSet() ) ); }