import { GenericRequestHandlerChain } from '../handler/GenericRequestHandlerChain' ; import { RequestMapper } from './RequestMapper' ; /**
 * Generic implementation for  RequestMapper .
  export class GenericRequestMapper < Input , Output > implements RequestMapper < Input , Output > { protected requestHandlerChains : Array < GenericRequestHandlerChain < Input , Output > > ; constructor ( options ) { this . requestHandlerChains = options . requestHandlerChains ; } public async getRequestHandlerChain ( input ) { for ( const requestHandlerChain of this . requestHandlerChains ) { const requestHandler = requestHandlerChain . getRequestHandler ( ) ; if ( await requestHandler . canHandle ( input ) ) { return requestHandlerChain ; } } return null ; } }