class RequestEnvelopeArgumentResolver implements ArgumentResolver {

    @Override
    public Optional<Object> resolve(ArgumentResolverContext input) {
        if (input.parameterTypeEquals(RequestEnvelope.class)) {
            return Optional.of(input.getHandlerInput().getRequestEnvelope());
        }
        return Optional.empty();
    }

}