public static RequestPatternBuilder like ( RequestPattern requestPattern ) { RequestPatternBuilder builder = new RequestPatternBuilder ( ) ; builder . url = requestPattern . getUrlMatcher ( ) ; builder . method = requestPattern . getMethod ( ) ; if ( requestPattern . getHeaders ( ) != null ) { builder . headers = requestPattern . getHeaders ( ) ; } if ( requestPattern . getQueryParameters ( ) != null ) { builder . queryParams = requestPattern . getQueryParameters ( ) ; } if ( requestPattern . getCookies ( ) != null ) { builder . cookies = requestPattern . getCookies ( ) ; } if ( requestPattern . getBodyPatterns ( ) != null ) { builder . bodyPatterns = requestPattern . getBodyPatterns ( ) ; } if ( requestPattern . hasInlineCustomMatcher ( ) ) { builder . customMatcher = requestPattern . getMatcher ( ) ; } if ( requestPattern . getMultipartPatterns ( ) != null ) { builder . multiparts = requestPattern . getMultipartPatterns ( ) ; } builder . basicCredentials = requestPattern . getBasicAuthCredentials ( ) ; builder . customMatcherDefinition = requestPattern . getCustomMatcher ( ) ; return builder ; }
Construct a builder that uses an existing RequestPattern as a template