public class CORSRule extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
CORSRule.AllowedMethods
Enumeration of names of the all the allowed methods.
|
Modifier and Type | Method and Description |
---|---|
List<String> |
getAllowedHeaders()
Returns allowed headers of this rule.
|
List<CORSRule.AllowedMethods> |
getAllowedMethods()
Returns the allowed methods of this rule.
|
List<String> |
getAllowedOrigins()
Returns the allowed origins of this rule and returns a reference to this object for method chaining.
|
List<String> |
getExposedHeaders()
Returns expose headers of this rule and returns a reference to this object for method chaining.
|
String |
getId()
Returns the Id of this rule.
|
int |
getMaxAgeSeconds()
Sets the ID of this rule and returns a reference to this object for method chaining.
|
void |
setAllowedHeaders(List<String> allowedHeaders)
Sets the allowed headers for the rule.
|
void |
setAllowedHeaders(String... allowedHeaders)
Convenience array style method for
setAllowedHeaders(List) |
void |
setAllowedMethods(CORSRule.AllowedMethods... allowedMethods)
Convenience array style method for
setAllowedMethods(List) |
void |
setAllowedMethods(List<CORSRule.AllowedMethods> allowedMethods)
Sets the allowed methods of the rule.
|
void |
setAllowedOrigins(List<String> allowedOrigins)
Sets the allowed origins of the rule.
|
void |
setAllowedOrigins(String... allowedOrigins)
Convenience array style method for
setAllowedOrigins(List) |
void |
setExposedHeaders(List<String> exposedHeaders)
Sets the expose headers of the rule.
|
void |
setExposedHeaders(String... exposedHeaders)
Convenience array style method for
setExposedHeaders(List) |
void |
setId(String id)
Sets the ID of this rule.
|
void |
setMaxAgeSeconds(int maxAgeSeconds)
Sets the max age in seconds of the rule.
|
CORSRule |
withAllowedHeaders(List<String> allowedHeaders)
Sets the allowed headers of this rule and returns a reference to this object for method chaining.
|
CORSRule |
withAllowedMethods(List<CORSRule.AllowedMethods> allowedMethods)
Sets the allowed methods of this rule and returns a reference to this object for method chaining.
|
CORSRule |
withAllowedOrigins(List<String> allowedOrigins)
Sets the allowed origins of this rule and returns a reference to this object for method chaining.
|
CORSRule |
withExposedHeaders(List<String> exposedHeaders)
Sets the exposeHeaders of this rule and returns a reference to this object for method chaining.
|
CORSRule |
withId(String id)
Sets the ID of this rule and returns a reference to this object for method chaining.
|
CORSRule |
withMaxAgeSeconds(int maxAgeSeconds)
Sets the max age in seconds of this rule and returns a reference to this object for method chaining.
|
public CORSRule(String id)
public String getId()
public void setId(String id)
id
- Sets the ID of this rule. Rules must be less than 255 alphanumeric characters, and must be unique for a bucket. If you do not assign an ID, one will be generated.public CORSRule withId(String id)
id
- Sets the ID of this rule.setId(String)
public void setAllowedMethods(List<CORSRule.AllowedMethods> allowedMethods)
allowedMethods
- Sets the allowed methods of the rule(List).public List<CORSRule.AllowedMethods> getAllowedMethods()
public void setAllowedMethods(CORSRule.AllowedMethods... allowedMethods)
setAllowedMethods(List)
allowedMethods
- Convenience array style method for setAllowedMethods(List)
public CORSRule withAllowedMethods(List<CORSRule.AllowedMethods> allowedMethods)
allowedMethods
- Convenience array style method for setAllowedMethods(List)
setAllowedMethods(List)
public void setAllowedOrigins(List<String> allowedOrigins)
allowedOrigins
- Sets the allowed origins of the rule.public List<String> getAllowedOrigins()
public void setAllowedOrigins(String... allowedOrigins)
setAllowedOrigins(List)
allowedOrigins
- Convenience array style method for setAllowedOrigins(List)
public CORSRule withAllowedOrigins(List<String> allowedOrigins)
allowedOrigins
- Sets the allowed origins of the rule.setAllowedOrigins(List)
public int getMaxAgeSeconds()
setId(String)
public void setMaxAgeSeconds(int maxAgeSeconds)
maxAgeSeconds
- Sets the max age in seconds of this rulepublic CORSRule withMaxAgeSeconds(int maxAgeSeconds)
maxAgeSeconds
- Sets the max age in seconds of this rulesetMaxAgeSeconds(int)
public void setExposedHeaders(List<String> exposedHeaders)
exposedHeaders
- Sets the expose headers of the rule.public List<String> getExposedHeaders()
public void setExposedHeaders(String... exposedHeaders)
setExposedHeaders(List)
exposedHeaders
- Convenience array style method for setExposedHeaders(List)
public CORSRule withExposedHeaders(List<String> exposedHeaders)
exposedHeaders
- Sets the allowed headers of this rule(List).setExposedHeaders(List)
public void setAllowedHeaders(List<String> allowedHeaders)
allowedHeaders
- Sets the allowed headers for the rule(List)
.public List<String> getAllowedHeaders()
public void setAllowedHeaders(String... allowedHeaders)
setAllowedHeaders(List)
allowedHeaders
- Convenience array style method for setAllowedHeaders(List)
public CORSRule withAllowedHeaders(List<String> allowedHeaders)
allowedHeaders
- Sets the allowed headers of this rule.setAllowedHeaders(List)
Copyright © 2010–2019. All rights reserved.