Class WebEndpointMapping.Builder<E>
java.lang.Object
io.microsphere.spring.web.metadata.WebEndpointMapping.Builder<E>
- Enclosing class:
- WebEndpointMapping<E>
-
Method Summary
Modifier and TypeMethodDescriptionbuild()BuildWebEndpointMappingAdd a single media type to the endpoint mapping that it can consume.consume(org.springframework.http.MediaType mediaType) Add a single media type to the endpoint mapping that it can consume.Set multiple media types to the endpoint mapping that it can consume.consumes(Collection<V> values, Function<V, String> stringFunction) Set multiple media types to the endpoint mapping that it can consume from a collection of values.consumes(org.springframework.http.MediaType... mediaTypes) Set multiple media types to the endpoint mapping that it can consume.Set the endpoint for the WebEndpointMapping.Add a single request header to the endpoint mapping.Add a single request header to the endpoint mapping.Set multiple request headers to the endpoint mapping.headers(Collection<V> values, Function<V, String> stringFunction) Set multiple request headers to the endpoint mapping from a collection of values.Add a single HTTP method to the endpoint mapping.method(org.springframework.http.HttpMethod method) Add a single HTTP method to the endpoint mapping.Set multiple HTTP methods to the endpoint mapping.methods(Collection<String> methods) methods(Collection<V> values, Function<V, String> stringFunction) Set multiple HTTP methods to the endpoint mapping from a collection of values.methods(org.springframework.http.HttpMethod... methods) Set multiple HTTP methods to the endpoint mapping.negate()nestConsumes(WebEndpointMapping.Builder<?> other) nestHeaders(WebEndpointMapping.Builder<?> other) nestMethods(WebEndpointMapping.Builder<?> other) nestParams(WebEndpointMapping.Builder<?> other) nestPatterns(WebEndpointMapping.Builder<?> other) nestProduces(WebEndpointMapping.Builder<?> other) newSet()protected static StringAdd a single request parameter to the endpoint mapping.Add a single request parameter to the endpoint mapping.Set multiple request parameters to the endpoint mapping.params(Collection<V> values, Function<V, String> stringFunction) Set multiple request parameters to the endpoint mapping from a collection of values.Add a single path pattern to the endpoint mapping.Set multiple path patterns to the endpoint mapping.patterns(Collection<String> patterns) Set multiple path patterns to the endpoint mapping.patterns(Collection<V> values, Function<V, String> stringFunction) Set multiple path patterns to the endpoint mapping from a collection of values.Add a single media type to the endpoint mapping that it can produce.produce(org.springframework.http.MediaType mediaType) Add a single media type to the endpoint mapping that it can produce.Set multiple media types to the endpoint mapping that it can produce.produces(Collection<V> values, Function<V, String> stringFunction) Set multiple media types to the endpoint mapping that it can produce from a collection of values.produces(org.springframework.http.MediaType... mediaTypes) Set multiple media types to the endpoint mapping that it can produce.Set the source of the endpoint mapping.toString()protected static String[]toStrings(Collection<String> values) protected static <V> String[]toStrings(Collection<V> values, Function<V, String> stringFunction)
-
Method Details
-
endpoint
Set the endpoint for the WebEndpointMapping.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.endpoint("myServlet"); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.endpoint(handlerMethod);- Parameters:
endpoint- the endpoint (must not be null)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the endpoint is null
-
pattern
@Nonnull public WebEndpointMapping.Builder<E> pattern(@Nonnull String pattern) throws IllegalArgumentException Add a single path pattern to the endpoint mapping.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.pattern("/api/users"); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.pattern("/api/products/{id}");- Parameters:
pattern- the path pattern to add (must not be null or blank)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the pattern is null or blank
-
patterns
@Nonnull public <V> WebEndpointMapping.Builder<E> patterns(Collection<V> values, Function<V, String> stringFunction) Set multiple path patterns to the endpoint mapping from a collection of values.Example Usage
// For a servlet endpoint with a list of pattern strings List<String> patternList = Arrays.asList("/api/users", "/api/orders"); WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.patterns(patternList, Function.identity()); // For a WebFlux endpoint with custom objects that have a getName() method List<MyPathPattern> patterns = getCustomPatternObjects(); WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.patterns(patterns, MyPathPattern::getName);- Type Parameters:
V- the type of values in the collection- Parameters:
values- the collection of values to convert to patterns (must not be null)stringFunction- the function to convert each value to a string pattern (must not be null)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the values or stringFunction is null
-
patterns
@Nonnull public WebEndpointMapping.Builder<E> patterns(@Nonnull String... patterns) throws IllegalArgumentException Set multiple path patterns to the endpoint mapping.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.patterns("/api/users", "/api/orders"); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.patterns("/api/products/{id}", "/api/categories/{categoryId}");- Parameters:
patterns- the path patterns to add (must not be null or empty)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the patterns array is null, empty, or contains null elements
-
patterns
Set multiple path patterns to the endpoint mapping.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.patterns(Arrays.asList("/api/users", "/api/orders")); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.patterns(Arrays.asList("/api/products/{id}", "/api/categories/{categoryId}"));- Parameters:
patterns- the collection of path patterns to add (must not be null or empty)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the patterns collection is null, empty, or contains null elements
-
method
@Nonnull public WebEndpointMapping.Builder<E> method(@Nonnull org.springframework.http.HttpMethod method) throws IllegalArgumentException Add a single HTTP method to the endpoint mapping.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.method(HttpMethod.GET); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.method(HttpMethod.POST);- Parameters:
method- the HTTP method to add (must not be null)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the method is null
-
method
@Nonnull public WebEndpointMapping.Builder<E> method(@Nonnull String method) throws IllegalArgumentException Add a single HTTP method to the endpoint mapping.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.method("GET"); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.method("POST");- Parameters:
method- the HTTP method to add (must not be null)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the method is null
-
methods
@Nonnull public <V> WebEndpointMapping.Builder<E> methods(Collection<V> values, Function<V, String> stringFunction) Set multiple HTTP methods to the endpoint mapping from a collection of values.Example Usage
// For a servlet endpoint with a list of HttpMethod enums List<HttpMethod> methodList = Arrays.asList(HttpMethod.GET, HttpMethod.POST); WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.methods(methodList, HttpMethod::name); // For a WebFlux endpoint with custom objects that have a getMethodName() method List<MyHttpMethod> methods = getCustomMethodObjects(); WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.methods(methods, MyHttpMethod::getMethodName);- Type Parameters:
V- the type of values in the collection- Parameters:
values- the collection of values to convert to HTTP methods (must not be null)stringFunction- the function to convert each value to an HTTP method string (must not be null)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the values or stringFunction is null
-
methods
@Nonnull public WebEndpointMapping.Builder<E> methods(@Nonnull org.springframework.http.HttpMethod... methods) throws IllegalArgumentException Set multiple HTTP methods to the endpoint mapping.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.methods(HttpMethod.GET, HttpMethod.POST); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.methods(HttpMethod.PUT, HttpMethod.DELETE);- Parameters:
methods- the HTTP methods to add (must not be null or empty)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the methods array is null, empty, or contains null elements
-
methods
@Nonnull public WebEndpointMapping.Builder<E> methods(@Nonnull String... methods) throws IllegalArgumentException Set multiple HTTP methods to the endpoint mapping.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.methods("GET", "POST"); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.methods("PUT", "DELETE");- Parameters:
methods- the HTTP methods to add (must not be null or empty)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the methods array is null, empty, or contains null elements
-
methods
public WebEndpointMapping.Builder<E> methods(@Nonnull Collection<String> methods) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
param
@Nonnull public WebEndpointMapping.Builder<E> param(@Nonnull String name, @Nullable String value) throws IllegalArgumentException Add a single request parameter to the endpoint mapping.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.param("version", "v1"); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.param("userId", 12345);- Parameters:
name- the parameter name (must not be blank)value- the parameter value (can be null)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the name is blank
-
param
@Nonnull public WebEndpointMapping.Builder<E> param(@Nonnull String nameAndValue) throws IllegalArgumentException Add a single request parameter to the endpoint mapping.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.param("version=v1"); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.param("userId=12345");- Parameters:
nameAndValue- the parameter name and value in the format "name=value" (must not be null)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the nameAndValue is null
-
params
@Nonnull public <V> WebEndpointMapping.Builder<E> params(Collection<V> values, Function<V, String> stringFunction) Set multiple request parameters to the endpoint mapping from a collection of values.Example Usage
// For a servlet endpoint with a list of parameter objects List<MyParam> paramList = Arrays.asList(new MyParam("version", "v1"), new MyParam("lang", "en")); WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.params(paramList, p -> p.getName() + "=" + p.getValue()); // For a WebFlux endpoint with custom objects that have a toString() method List<MyQueryParam> queryParams = getCustomParamObjects(); WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.params(queryParams, MyQueryParam::toString);- Type Parameters:
V- the type of values in the collection- Parameters:
values- the collection of values to convert to parameters (must not be null)stringFunction- the function to convert each value to a parameter string (must not be null)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the values or stringFunction is null
-
params
Set multiple request parameters to the endpoint mapping.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.params("version=v1", "lang=en"); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.params("userId=12345", "active=true");- Parameters:
params- the request parameters to add (can be null or empty)- Returns:
- this builder instance for method chaining
-
header
@Nonnull public <V> WebEndpointMapping.Builder<E> header(@Nonnull String name, @Nullable String value) Add a single request header to the endpoint mapping.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.header("X-API-Version", "v1"); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.header("Authorization", "Bearer token");- Parameters:
name- the header name (must not be blank)value- the header value (can be null)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the name is blank
-
header
@Nonnull public WebEndpointMapping.Builder<E> header(@Nonnull String nameAndValue) throws IllegalArgumentException Add a single request header to the endpoint mapping.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.header("X-API-Version:v1"); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.header("Authorization:Bearer token");- Parameters:
nameAndValue- the header name and value in the format "name:value" (must not be null)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the nameAndValue is null
-
headers
@Nonnull public <V> WebEndpointMapping.Builder<E> headers(Collection<V> values, Function<V, String> stringFunction) Set multiple request headers to the endpoint mapping from a collection of values.Example Usage
// For a servlet endpoint with a list of header objects List<MyHeader> headerList = Arrays.asList(new MyHeader("X-API-Version", "v1"), new MyHeader("Accept-Language", "en")); WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.headers(headerList, h -> h.getName() + ":" + h.getValue()); // For a WebFlux endpoint with custom objects that have a toString() method List<MyRequestHeader> requestHeaders = getCustomHeaderObjects(); WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.headers(requestHeaders, MyRequestHeader::toString);- Type Parameters:
V- the type of values in the collection- Parameters:
values- the collection of values to convert to headers (must not be null)stringFunction- the function to convert each value to a header string (must not be null)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the values or stringFunction is null
-
headers
Set multiple request headers to the endpoint mapping.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.headers("X-API-Version:v1", "Accept-Language:en"); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.headers("Authorization:Bearer token", "X-Request-ID:12345");- Parameters:
headers- the request headers to add (can be null or empty)- Returns:
- this builder instance for method chaining
-
consume
Add a single media type to the endpoint mapping that it can consume.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.consume(MediaType.APPLICATION_JSON); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.consume(MediaType.TEXT_PLAIN);- Parameters:
mediaType- the media type to consume (must not be null)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the mediaType is null
-
consume
Add a single media type to the endpoint mapping that it can consume.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.consume("application/json"); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.consume("text/plain");- Parameters:
consume- the media type to consume (must not be blank)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the consume is blank
-
consumes
@Nonnull public WebEndpointMapping.Builder<E> consumes(org.springframework.http.MediaType... mediaTypes) Set multiple media types to the endpoint mapping that it can consume.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.consumes(MediaType.APPLICATION_JSON, MediaType.TEXT_XML); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.consumes(MediaType.TEXT_PLAIN, MediaType.APPLICATION_OCTET_STREAM);- Parameters:
mediaTypes- the media types to consume (must not be null or contain null elements)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the mediaTypes array is null or contains null elements
-
consumes
@Nonnull public <V> WebEndpointMapping.Builder<E> consumes(Collection<V> values, Function<V, String> stringFunction) Set multiple media types to the endpoint mapping that it can consume from a collection of values.Example Usage
// For a servlet endpoint with a list of MediaType objects List<MediaType> mediaTypeList = Arrays.asList(MediaType.APPLICATION_JSON, MediaType.TEXT_XML); WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.consumes(mediaTypeList, MediaType::toString); // For a WebFlux endpoint with custom objects that have a getMimeType() method List<MyMediaType> customMediaTypes = getCustomMediaTypes(); WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.consumes(customMediaTypes, MyMediaType::getMimeType);- Type Parameters:
V- the type of values in the collection- Parameters:
values- the collection of values to convert to media types (must not be null)stringFunction- the function to convert each value to a media type string (must not be null)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the values or stringFunction is null
-
consumes
Set multiple media types to the endpoint mapping that it can consume.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.consumes("application/json", "text/xml"); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.consumes("text/plain", "application/octet-stream");- Parameters:
consumes- the media types to consume (can be null or empty)- Returns:
- this builder instance for method chaining
-
produce
Add a single media type to the endpoint mapping that it can produce.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.produce(MediaType.APPLICATION_JSON); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.produce(MediaType.TEXT_PLAIN);- Parameters:
mediaType- the media type to produce (must not be null)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the mediaType is null
-
produce
Add a single media type to the endpoint mapping that it can produce.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.produce("application/json"); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.produce("text/plain");- Parameters:
produce- the media type to produce (must not be blank)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the produce is blank
-
produces
@Nonnull public WebEndpointMapping.Builder<E> produces(org.springframework.http.MediaType... mediaTypes) Set multiple media types to the endpoint mapping that it can produce.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.produces(MediaType.APPLICATION_JSON, MediaType.TEXT_XML); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.produces(MediaType.TEXT_PLAIN, MediaType.APPLICATION_OCTET_STREAM);- Parameters:
mediaTypes- the media types to produce (must not be null or contain null elements)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the mediaTypes array is null or contains null elements
-
produces
@Nonnull public <V> WebEndpointMapping.Builder<E> produces(Collection<V> values, Function<V, String> stringFunction) Set multiple media types to the endpoint mapping that it can produce from a collection of values.Example Usage
// For a servlet endpoint with a list of MediaType objects List<MediaType> mediaTypeList = Arrays.asList(MediaType.APPLICATION_JSON, MediaType.TEXT_XML); WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.produces(mediaTypeList, MediaType::toString); // For a WebFlux endpoint with custom objects that have a getMimeType() method List<MyMediaType> customMediaTypes = getCustomMediaTypes(); WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.produces(customMediaTypes, MyMediaType::getMimeType);- Type Parameters:
V- the type of values in the collection- Parameters:
values- the collection of values to convert to media types (must not be null)stringFunction- the function to convert each value to a media type string (must not be null)- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- if the values or stringFunction is null
-
produces
Set multiple media types to the endpoint mapping that it can produce.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.produces("application/json", "text/xml"); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.produces("text/plain", "application/octet-stream");- Parameters:
produces- the media types to produce (can be null or empty)- Returns:
- this builder instance for method chaining
-
negate
-
source
Set the source of the endpoint mapping.Example Usage
// For a servlet endpoint WebEndpointMapping.Builder<String> builder = WebEndpointMapping.servlet("myServlet"); builder.source(servletContext); // For a WebFlux endpoint WebEndpointMapping.Builder<HandlerMethod> webFluxBuilder = WebEndpointMapping.webflux(handlerMethod); webFluxBuilder.source(handlerMapping);- Parameters:
source- the source object (can be null)- Returns:
- this builder instance for method chaining
-
nestPatterns
@Nonnull public WebEndpointMapping.Builder<E> nestPatterns(@Nonnull WebEndpointMapping.Builder<?> other) -
nestMethods
@Nonnull public WebEndpointMapping.Builder<E> nestMethods(@Nonnull WebEndpointMapping.Builder<?> other) -
nestParams
@Nonnull public WebEndpointMapping.Builder<E> nestParams(@Nonnull WebEndpointMapping.Builder<?> other) -
nestHeaders
@Nonnull public WebEndpointMapping.Builder<E> nestHeaders(@Nonnull WebEndpointMapping.Builder<?> other) -
nestConsumes
@Nonnull public WebEndpointMapping.Builder<E> nestConsumes(@Nonnull WebEndpointMapping.Builder<?> other) -
nestProduces
@Nonnull public WebEndpointMapping.Builder<E> nestProduces(@Nonnull WebEndpointMapping.Builder<?> other) -
toString
-
pair
-
newSet
-
toStrings
-
toStrings
-
build
BuildWebEndpointMapping- Returns:
- non-null
- Throws:
IllegalArgumentException- if "endpoint" or "patterns" or "methods" is empty or has any null element
-