public static final class CorsConfiguration.Builder extends Object
CorsConfiguration.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
public final CorsConfiguration.Builder from(CorsConfiguration instance)
CorsConfiguration instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.
Collection elements and entries will be added, not replaced.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedCredentials(Boolean allowedCredentials)
allowedCredentials attribute.allowedCredentials - The value for allowedCredentialsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedHeader(String element)
allowedHeaders list.element - A allowedHeaders elementthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedHeaders(String... elements)
allowedHeaders list.elements - An array of allowedHeaders elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedHeaders(Iterable<String> elements)
allowedHeaders list.elements - An iterable of allowedHeaders elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder addAllAllowedHeaders(Iterable<String> elements)
allowedHeaders list.elements - An iterable of allowedHeaders elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedMethod(String element)
allowedMethods list.element - A allowedMethods elementthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedMethods(String... elements)
allowedMethods list.elements - An array of allowedMethods elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedMethods(Iterable<String> elements)
allowedMethods list.elements - An iterable of allowedMethods elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder addAllAllowedMethods(Iterable<String> elements)
allowedMethods list.elements - An iterable of allowedMethods elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedOriginPattern(String element)
allowedOriginPatterns list.element - A allowedOriginPatterns elementthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedOriginPatterns(String... elements)
allowedOriginPatterns list.elements - An array of allowedOriginPatterns elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedOriginPatterns(Iterable<String> elements)
allowedOriginPatterns list.elements - An iterable of allowedOriginPatterns elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder addAllAllowedOriginPatterns(Iterable<String> elements)
allowedOriginPatterns list.elements - An iterable of allowedOriginPatterns elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedOrigin(String element)
allowedOrigins list.element - A allowedOrigins elementthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedOrigins(String... elements)
allowedOrigins list.elements - An array of allowedOrigins elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedOrigins(Iterable<String> elements)
allowedOrigins list.elements - An iterable of allowedOrigins elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder addAllAllowedOrigins(Iterable<String> elements)
allowedOrigins list.elements - An iterable of allowedOrigins elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedUriPattern(String element)
allowedUriPatterns list.element - A allowedUriPatterns elementthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedUriPatterns(String... elements)
allowedUriPatterns list.elements - An array of allowedUriPatterns elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedUriPatterns(Iterable<String> elements)
allowedUriPatterns list.elements - An iterable of allowedUriPatterns elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder addAllAllowedUriPatterns(Iterable<String> elements)
allowedUriPatterns list.elements - An iterable of allowedUriPatterns elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedUri(String element)
allowedUris list.element - A allowedUris elementthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedUris(String... elements)
allowedUris list.elements - An array of allowedUris elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder allowedUris(Iterable<String> elements)
allowedUris list.elements - An iterable of allowedUris elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder addAllAllowedUris(Iterable<String> elements)
allowedUris list.elements - An iterable of allowedUris elementsthis builder for use in a chained invocationpublic final CorsConfiguration.Builder maxAge(Long maxAge)
maxAge attribute.maxAge - The value for maxAgethis builder for use in a chained invocationpublic CorsConfiguration build()
CorsConfiguration.IllegalStateException - if any required attributes are missingCopyright © 2020. All rights reserved.