public Iterable < HttpHeader > headers ( Object [ ] swaggerMethodArguments ) { final HttpHeaders result = new HttpHeaders ( headers ) ; if ( headerSubstitutions != null ) { for ( Substitution headerSubstitution : headerSubstitutions ) { final int parameterIndex = headerSubstitution . methodParameterIndex ( ) ; if ( 0 <= parameterIndex && parameterIndex < swaggerMethodArguments . length ) { final Object methodArgument = swaggerMethodArguments [ headerSubstitution . methodParameterIndex ( ) ] ; if ( methodArgument instanceof Map ) { final Map < String , ? > headerCollection = ( Map < String , ? > ) methodArgument ; final String headerCollectionPrefix = headerSubstitution . urlParameterName ( ) ; for ( final Map . Entry < String , ? > headerCollectionEntry : headerCollection . entrySet ( ) ) { final String headerName = headerCollectionPrefix + headerCollectionEntry . getKey ( ) ; final String headerValue = serialize ( headerCollectionEntry . getValue ( ) ) ; result . set ( headerName , headerValue ) ; } } else { final String headerName = headerSubstitution . urlParameterName ( ) ; final String headerValue = serialize ( methodArgument ) ; result . set ( headerName , headerValue ) ; } } } } return result ; }
Get the headers that have been added to this value based on the provided method arguments .