private void swapRequestInterceptor ( Class < ? extends Interceptor > target , Interceptor interceptor ) { List < Interceptor > list = this . getRequestInterceptors ( ) ; for ( Interceptor object : list ) { if ( object . getClass ( ) == target ) { list . set ( list . indexOf ( object ) , interceptor ) ; } } this . setRequestInterceptors ( list ) ; }
Swap one interceptor with new one