Class FormDataInserter
- java.lang.Object
-
- org.bremersee.apiclient.webflux.contract.spring.AbstractRequestBodyInserter
-
- org.bremersee.apiclient.webflux.contract.spring.SingleBodyInserter<org.springframework.util.MultiValueMap<String,?>>
-
- org.bremersee.apiclient.webflux.contract.spring.FormDataInserter
-
- All Implemented Interfaces:
BiFunction<Invocation,org.springframework.web.reactive.function.client.WebClient.RequestBodyUriSpec,org.springframework.web.reactive.function.client.WebClient.RequestHeadersUriSpec<?>>
,RequestBodyInserter
public class FormDataInserter extends SingleBodyInserter<org.springframework.util.MultiValueMap<String,?>>
The form data inserter.- Author:
- Christian Bremer
-
-
Constructor Summary
Constructors Constructor Description FormDataInserter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canInsert(Invocation invocation)
Can insert boolean.protected org.springframework.web.reactive.function.client.WebClient.RequestHeadersUriSpec<?>
insert(org.springframework.util.MultiValueMap<String,?> body, org.springframework.web.reactive.function.client.WebClient.RequestBodyUriSpec requestBodyUriSpec)
Insert request headers uri spec.protected boolean
isFormData(Invocation invocation)
Is form data.protected boolean
isPossibleBodyValue(InvocationParameter invocationParameter)
Is possible body value boolean.protected org.springframework.util.MultiValueMap<String,?>
mapBody(InvocationParameter invocationParameter)
Map body.FormDataInserter
withContentTypeResolver(Function<Invocation,Optional<org.springframework.http.MediaType>> contentTypeResolver)
With content type resolver.-
Methods inherited from class org.bremersee.apiclient.webflux.contract.spring.SingleBodyInserter
apply
-
Methods inherited from class org.bremersee.apiclient.webflux.contract.spring.AbstractRequestBodyInserter
canInsert, findPossibleBodies, hasMappingAnnotation, isPossibleBody
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.BiFunction
andThen
-
-
-
-
Method Detail
-
withContentTypeResolver
public FormDataInserter withContentTypeResolver(Function<Invocation,Optional<org.springframework.http.MediaType>> contentTypeResolver)
With content type resolver.- Parameters:
contentTypeResolver
- the content type resolver- Returns:
- the form data inserter
-
canInsert
public boolean canInsert(Invocation invocation)
Description copied from interface:RequestBodyInserter
Can insert boolean.- Specified by:
canInsert
in interfaceRequestBodyInserter
- Overrides:
canInsert
in classAbstractRequestBodyInserter
- Parameters:
invocation
- the invocation- Returns:
- the boolean
-
isFormData
protected boolean isFormData(Invocation invocation)
Is form data.- Parameters:
invocation
- the invocation- Returns:
- the boolean
-
mapBody
protected org.springframework.util.MultiValueMap<String,?> mapBody(InvocationParameter invocationParameter)
Description copied from class:SingleBodyInserter
Map body.- Specified by:
mapBody
in classSingleBodyInserter<org.springframework.util.MultiValueMap<String,?>>
- Parameters:
invocationParameter
- the invocation parameter- Returns:
- the t
-
isPossibleBodyValue
protected boolean isPossibleBodyValue(InvocationParameter invocationParameter)
Description copied from class:AbstractRequestBodyInserter
Is possible body value boolean.- Specified by:
isPossibleBodyValue
in classSingleBodyInserter<org.springframework.util.MultiValueMap<String,?>>
- Parameters:
invocationParameter
- the invocation parameter- Returns:
- the boolean
-
insert
protected org.springframework.web.reactive.function.client.WebClient.RequestHeadersUriSpec<?> insert(org.springframework.util.MultiValueMap<String,?> body, org.springframework.web.reactive.function.client.WebClient.RequestBodyUriSpec requestBodyUriSpec)
Description copied from class:SingleBodyInserter
Insert request headers uri spec.- Specified by:
insert
in classSingleBodyInserter<org.springframework.util.MultiValueMap<String,?>>
- Parameters:
body
- the bodyrequestBodyUriSpec
- the request body uri spec- Returns:
- the request headers uri spec
-
-