private void deleteFromIndices ( ApiType oldObj , String key ) { for ( Map . Entry < String , Function < ApiType , List < String > > > indexEntry : this . indexers . entrySet ( ) ) { Function < ApiType , List < String > > indexFunc = indexEntry . getValue ( ) ; List < String > indexValues = indexFunc . apply ( oldObj ) ; if ( io . kubernetes . client . util . common . Collections . isEmptyCollection ( indexValues ) ) { continue ; } Map < String , Set < String > > index = this . indices . get ( indexEntry . getKey ( ) ) ; if ( index == null ) { continue ; } for ( String indexValue : indexValues ) { Set < String > indexSet = index . get ( indexValue ) ; if ( indexSet != null ) { indexSet . remove ( key ) ; } } } }
deleteFromIndices removes the object from each of the managed indexes .