File tree Expand file tree Collapse file tree 4 files changed +14
-7
lines changed
spring-webflux/src/main/java/org/springframework/web/reactive/function/client
spring-web/src/main/java/org/springframework/http Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
70
70
* @param <T> the body type
71
71
* @see #getMethod()
72
72
* @see #getUrl()
73
+ * @see org.springframework.web.client.RestOperations#exchange(RequestEntity, Class)
74
+ * @see ResponseEntity
73
75
*/
74
76
public class RequestEntity <T > extends HttpEntity <T > {
75
77
Original file line number Diff line number Diff line change 70
70
* @since 3.0.2
71
71
* @param <T> the body type
72
72
* @see #getStatusCode()
73
+ * @see org.springframework.web.client.RestOperations#getForEntity(String, Class, Object...)
74
+ * @see org.springframework.web.client.RestOperations#getForEntity(String, Class, java.util.Map)
75
+ * @see org.springframework.web.client.RestOperations#getForEntity(URI, Class)
76
+ * @see RequestEntity
73
77
*/
74
78
public class ResponseEntity <T > extends HttpEntity <T > {
75
79
Original file line number Diff line number Diff line change @@ -417,26 +417,23 @@ public HttpHeaders getHeaders() {
417
417
418
418
private static class DefaultResponseSpec implements ResponseSpec {
419
419
420
- private static final IntPredicate STATUS_CODE_ERROR = value -> value >= 400 ;
420
+ private static final IntPredicate STATUS_CODE_ERROR = ( value -> value >= 400 ) ;
421
421
422
422
private static final StatusHandler DEFAULT_STATUS_HANDLER =
423
423
new StatusHandler (STATUS_CODE_ERROR , ClientResponse ::createException );
424
424
425
-
426
425
private final Mono <ClientResponse > responseMono ;
427
426
428
427
private final Supplier <HttpRequest > requestSupplier ;
429
428
430
429
private final List <StatusHandler > statusHandlers = new ArrayList <>(1 );
431
430
432
-
433
431
DefaultResponseSpec (Mono <ClientResponse > responseMono , Supplier <HttpRequest > requestSupplier ) {
434
432
this .responseMono = responseMono ;
435
433
this .requestSupplier = requestSupplier ;
436
434
this .statusHandlers .add (DEFAULT_STATUS_HANDLER );
437
435
}
438
436
439
-
440
437
@ Override
441
438
public ResponseSpec onStatus (Predicate <HttpStatus > statusPredicate ,
442
439
Function <ClientResponse , Mono <? extends Throwable >> exceptionFunction ) {
Original file line number Diff line number Diff line change @@ -101,20 +101,24 @@ public DefaultWebClientBuilder(DefaultWebClientBuilder other) {
101
101
this .defaultUriVariables = (other .defaultUriVariables != null ?
102
102
new LinkedHashMap <>(other .defaultUriVariables ) : null );
103
103
this .uriBuilderFactory = other .uriBuilderFactory ;
104
+
104
105
if (other .defaultHeaders != null ) {
105
106
this .defaultHeaders = new HttpHeaders ();
106
107
this .defaultHeaders .putAll (other .defaultHeaders );
107
108
}
108
109
else {
109
110
this .defaultHeaders = null ;
110
111
}
112
+
111
113
this .defaultCookies = (other .defaultCookies != null ?
112
114
new LinkedMultiValueMap <>(other .defaultCookies ) : null );
113
115
this .defaultRequest = other .defaultRequest ;
114
- this .filters = other .filters != null ? new ArrayList <>(other .filters ) : null ;
116
+ this .filters = (other .filters != null ? new ArrayList <>(other .filters ) : null );
117
+
115
118
this .connector = other .connector ;
116
119
this .strategies = other .strategies ;
117
- this .strategiesConfigurers = other .strategiesConfigurers != null ? new ArrayList <>(other .strategiesConfigurers ) : null ;
120
+ this .strategiesConfigurers = (other .strategiesConfigurers != null ?
121
+ new ArrayList <>(other .strategiesConfigurers ) : null );
118
122
this .exchangeFunction = other .exchangeFunction ;
119
123
}
120
124
You can’t perform that action at this time.
0 commit comments