ObjectBundle implements ObjectIndexProvider { @Nonnull @Override public Integer mergeObjectIndex( @Nonnull IdentifiableObject object ) { return typedIndexedObjectContainer.mergeObjectIndex( object ); } ObjectBundle( ObjectBundleParams params, Preheat preheat, Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> objectMap ); User getUser(); UserOverrideMode getUserOverrideMode(); User getOverrideUser(); void setOverrideUser( User overrideUser ); String getUsername(); ObjectBundleMode getObjectBundleMode(); PreheatIdentifier getPreheatIdentifier(); PreheatMode getPreheatMode(); ImportStrategy getImportMode(); AtomicMode getAtomicMode(); MergeMode getMergeMode(); FlushMode getFlushMode(); boolean isSkipSharing(); boolean isSkipTranslation(); boolean isSkipValidation(); boolean isMetadataSyncImport(); JobConfiguration getJobId(); boolean hasJobId(); ObjectBundleStatus getObjectBundleStatus(); void setObjectBundleStatus( ObjectBundleStatus objectBundleStatus ); Preheat getPreheat(); @Nonnull @Override Integer mergeObjectIndex( @Nonnull IdentifiableObject object ); boolean containsObject( @Nullable IdentifiableObject object ); Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> getObjectMap(); Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> getObjects( boolean persisted ); List<IdentifiableObject> getObjects( Class<? extends IdentifiableObject> klass, boolean persisted ); Map<String, Map<String, Object>> getObjectReferences( Class<?> klass ); Map<Class<?>, Map<String, Map<String, Object>>> getObjectReferences(); void setObjectReferences( Map<Class<?>, Map<String, Map<String, Object>>> objectReferences ); void putExtras( IdentifiableObject identifiableObject, String key, Object object ); Object getExtras( IdentifiableObject identifiableObject, String key ); boolean hasExtras( IdentifiableObject identifiableObject, String key ); void removeExtras( IdentifiableObject identifiableObject, String key ); boolean isPersisted( IdentifiableObject object );  }
@Test public void objectIndex() { Assert.assertEquals( (Integer) 2, objectBundle.mergeObjectIndex( attribute3 ) ); Assert.assertEquals( (Integer) 0, objectBundle.mergeObjectIndex( attribute1 ) ); Assert.assertEquals( (Integer) 1, objectBundle.mergeObjectIndex( attribute2 ) ); Assert.assertEquals( (Integer) 1, objectBundle.mergeObjectIndex( category2 ) ); Assert.assertEquals( (Integer) 0, objectBundle.mergeObjectIndex( category1 ) ); }