com.amazonaws.services.cloudfront.model.ResponseHeadersPolicyStrictTransportSecurity Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudfront Show documentation
/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.cloudfront.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Determines whether CloudFront includes the Strict-Transport-Security
HTTP response header and the
* header’s value.
*
*
* For more information about the Strict-Transport-Security
HTTP response header, see Strict-Transport-Security in the MDN Web Docs.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ResponseHeadersPolicyStrictTransportSecurity implements Serializable, Cloneable {
/**
*
* A Boolean that determines whether CloudFront overrides the Strict-Transport-Security
HTTP response
* header received from the origin with the one specified in this response headers policy.
*
*/
private Boolean override;
/**
*
* A Boolean that determines whether CloudFront includes the includeSubDomains
directive in the
* Strict-Transport-Security
HTTP response header.
*
*/
private Boolean includeSubdomains;
/**
*
* A Boolean that determines whether CloudFront includes the preload
directive in the
* Strict-Transport-Security
HTTP response header.
*
*/
private Boolean preload;
/**
*
* A number that CloudFront uses as the value for the max-age
directive in the
* Strict-Transport-Security
HTTP response header.
*
*/
private Integer accessControlMaxAgeSec;
/**
*
* A Boolean that determines whether CloudFront overrides the Strict-Transport-Security
HTTP response
* header received from the origin with the one specified in this response headers policy.
*
*
* @param override
* A Boolean that determines whether CloudFront overrides the Strict-Transport-Security
HTTP
* response header received from the origin with the one specified in this response headers policy.
*/
public void setOverride(Boolean override) {
this.override = override;
}
/**
*
* A Boolean that determines whether CloudFront overrides the Strict-Transport-Security
HTTP response
* header received from the origin with the one specified in this response headers policy.
*
*
* @return A Boolean that determines whether CloudFront overrides the Strict-Transport-Security
HTTP
* response header received from the origin with the one specified in this response headers policy.
*/
public Boolean getOverride() {
return this.override;
}
/**
*
* A Boolean that determines whether CloudFront overrides the Strict-Transport-Security
HTTP response
* header received from the origin with the one specified in this response headers policy.
*
*
* @param override
* A Boolean that determines whether CloudFront overrides the Strict-Transport-Security
HTTP
* response header received from the origin with the one specified in this response headers policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResponseHeadersPolicyStrictTransportSecurity withOverride(Boolean override) {
setOverride(override);
return this;
}
/**
*
* A Boolean that determines whether CloudFront overrides the Strict-Transport-Security
HTTP response
* header received from the origin with the one specified in this response headers policy.
*
*
* @return A Boolean that determines whether CloudFront overrides the Strict-Transport-Security
HTTP
* response header received from the origin with the one specified in this response headers policy.
*/
public Boolean isOverride() {
return this.override;
}
/**
*
* A Boolean that determines whether CloudFront includes the includeSubDomains
directive in the
* Strict-Transport-Security
HTTP response header.
*
*
* @param includeSubdomains
* A Boolean that determines whether CloudFront includes the includeSubDomains
directive in the
* Strict-Transport-Security
HTTP response header.
*/
public void setIncludeSubdomains(Boolean includeSubdomains) {
this.includeSubdomains = includeSubdomains;
}
/**
*
* A Boolean that determines whether CloudFront includes the includeSubDomains
directive in the
* Strict-Transport-Security
HTTP response header.
*
*
* @return A Boolean that determines whether CloudFront includes the includeSubDomains
directive in the
* Strict-Transport-Security
HTTP response header.
*/
public Boolean getIncludeSubdomains() {
return this.includeSubdomains;
}
/**
*
* A Boolean that determines whether CloudFront includes the includeSubDomains
directive in the
* Strict-Transport-Security
HTTP response header.
*
*
* @param includeSubdomains
* A Boolean that determines whether CloudFront includes the includeSubDomains
directive in the
* Strict-Transport-Security
HTTP response header.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResponseHeadersPolicyStrictTransportSecurity withIncludeSubdomains(Boolean includeSubdomains) {
setIncludeSubdomains(includeSubdomains);
return this;
}
/**
*
* A Boolean that determines whether CloudFront includes the includeSubDomains
directive in the
* Strict-Transport-Security
HTTP response header.
*
*
* @return A Boolean that determines whether CloudFront includes the includeSubDomains
directive in the
* Strict-Transport-Security
HTTP response header.
*/
public Boolean isIncludeSubdomains() {
return this.includeSubdomains;
}
/**
*
* A Boolean that determines whether CloudFront includes the preload
directive in the
* Strict-Transport-Security
HTTP response header.
*
*
* @param preload
* A Boolean that determines whether CloudFront includes the preload
directive in the
* Strict-Transport-Security
HTTP response header.
*/
public void setPreload(Boolean preload) {
this.preload = preload;
}
/**
*
* A Boolean that determines whether CloudFront includes the preload
directive in the
* Strict-Transport-Security
HTTP response header.
*
*
* @return A Boolean that determines whether CloudFront includes the preload
directive in the
* Strict-Transport-Security
HTTP response header.
*/
public Boolean getPreload() {
return this.preload;
}
/**
*
* A Boolean that determines whether CloudFront includes the preload
directive in the
* Strict-Transport-Security
HTTP response header.
*
*
* @param preload
* A Boolean that determines whether CloudFront includes the preload
directive in the
* Strict-Transport-Security
HTTP response header.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResponseHeadersPolicyStrictTransportSecurity withPreload(Boolean preload) {
setPreload(preload);
return this;
}
/**
*
* A Boolean that determines whether CloudFront includes the preload
directive in the
* Strict-Transport-Security
HTTP response header.
*
*
* @return A Boolean that determines whether CloudFront includes the preload
directive in the
* Strict-Transport-Security
HTTP response header.
*/
public Boolean isPreload() {
return this.preload;
}
/**
*
* A number that CloudFront uses as the value for the max-age
directive in the
* Strict-Transport-Security
HTTP response header.
*
*
* @param accessControlMaxAgeSec
* A number that CloudFront uses as the value for the max-age
directive in the
* Strict-Transport-Security
HTTP response header.
*/
public void setAccessControlMaxAgeSec(Integer accessControlMaxAgeSec) {
this.accessControlMaxAgeSec = accessControlMaxAgeSec;
}
/**
*
* A number that CloudFront uses as the value for the max-age
directive in the
* Strict-Transport-Security
HTTP response header.
*
*
* @return A number that CloudFront uses as the value for the max-age
directive in the
* Strict-Transport-Security
HTTP response header.
*/
public Integer getAccessControlMaxAgeSec() {
return this.accessControlMaxAgeSec;
}
/**
*
* A number that CloudFront uses as the value for the max-age
directive in the
* Strict-Transport-Security
HTTP response header.
*
*
* @param accessControlMaxAgeSec
* A number that CloudFront uses as the value for the max-age
directive in the
* Strict-Transport-Security
HTTP response header.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResponseHeadersPolicyStrictTransportSecurity withAccessControlMaxAgeSec(Integer accessControlMaxAgeSec) {
setAccessControlMaxAgeSec(accessControlMaxAgeSec);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getOverride() != null)
sb.append("Override: ").append(getOverride()).append(",");
if (getIncludeSubdomains() != null)
sb.append("IncludeSubdomains: ").append(getIncludeSubdomains()).append(",");
if (getPreload() != null)
sb.append("Preload: ").append(getPreload()).append(",");
if (getAccessControlMaxAgeSec() != null)
sb.append("AccessControlMaxAgeSec: ").append(getAccessControlMaxAgeSec());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ResponseHeadersPolicyStrictTransportSecurity == false)
return false;
ResponseHeadersPolicyStrictTransportSecurity other = (ResponseHeadersPolicyStrictTransportSecurity) obj;
if (other.getOverride() == null ^ this.getOverride() == null)
return false;
if (other.getOverride() != null && other.getOverride().equals(this.getOverride()) == false)
return false;
if (other.getIncludeSubdomains() == null ^ this.getIncludeSubdomains() == null)
return false;
if (other.getIncludeSubdomains() != null && other.getIncludeSubdomains().equals(this.getIncludeSubdomains()) == false)
return false;
if (other.getPreload() == null ^ this.getPreload() == null)
return false;
if (other.getPreload() != null && other.getPreload().equals(this.getPreload()) == false)
return false;
if (other.getAccessControlMaxAgeSec() == null ^ this.getAccessControlMaxAgeSec() == null)
return false;
if (other.getAccessControlMaxAgeSec() != null && other.getAccessControlMaxAgeSec().equals(this.getAccessControlMaxAgeSec()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getOverride() == null) ? 0 : getOverride().hashCode());
hashCode = prime * hashCode + ((getIncludeSubdomains() == null) ? 0 : getIncludeSubdomains().hashCode());
hashCode = prime * hashCode + ((getPreload() == null) ? 0 : getPreload().hashCode());
hashCode = prime * hashCode + ((getAccessControlMaxAgeSec() == null) ? 0 : getAccessControlMaxAgeSec().hashCode());
return hashCode;
}
@Override
public ResponseHeadersPolicyStrictTransportSecurity clone() {
try {
return (ResponseHeadersPolicyStrictTransportSecurity) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}