
com.amazonaws.services.lightsail.model.QueryStringObject Maven / Gradle / Ivy
/*
* Copyright 2018-2023 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.lightsail.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes the query string parameters that an Amazon Lightsail content delivery network (CDN) distribution to bases
* caching on.
*
*
* For the query strings that you specify, your distribution caches separate versions of the specified content based on
* the query string values in viewer requests.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class QueryStringObject implements Serializable, Cloneable, StructuredPojo {
/**
*
* Indicates whether the distribution forwards and caches based on query strings.
*
*/
private Boolean option;
/**
*
* The specific query strings that the distribution forwards to the origin.
*
*
* Your distribution will cache content based on the specified query strings.
*
*
* If the option
parameter is true, then your distribution forwards all query strings, regardless of
* what you specify using the queryStringsAllowList
parameter.
*
*/
private java.util.List queryStringsAllowList;
/**
*
* Indicates whether the distribution forwards and caches based on query strings.
*
*
* @param option
* Indicates whether the distribution forwards and caches based on query strings.
*/
public void setOption(Boolean option) {
this.option = option;
}
/**
*
* Indicates whether the distribution forwards and caches based on query strings.
*
*
* @return Indicates whether the distribution forwards and caches based on query strings.
*/
public Boolean getOption() {
return this.option;
}
/**
*
* Indicates whether the distribution forwards and caches based on query strings.
*
*
* @param option
* Indicates whether the distribution forwards and caches based on query strings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QueryStringObject withOption(Boolean option) {
setOption(option);
return this;
}
/**
*
* Indicates whether the distribution forwards and caches based on query strings.
*
*
* @return Indicates whether the distribution forwards and caches based on query strings.
*/
public Boolean isOption() {
return this.option;
}
/**
*
* The specific query strings that the distribution forwards to the origin.
*
*
* Your distribution will cache content based on the specified query strings.
*
*
* If the option
parameter is true, then your distribution forwards all query strings, regardless of
* what you specify using the queryStringsAllowList
parameter.
*
*
* @return The specific query strings that the distribution forwards to the origin.
*
* Your distribution will cache content based on the specified query strings.
*
*
* If the option
parameter is true, then your distribution forwards all query strings,
* regardless of what you specify using the queryStringsAllowList
parameter.
*/
public java.util.List getQueryStringsAllowList() {
return queryStringsAllowList;
}
/**
*
* The specific query strings that the distribution forwards to the origin.
*
*
* Your distribution will cache content based on the specified query strings.
*
*
* If the option
parameter is true, then your distribution forwards all query strings, regardless of
* what you specify using the queryStringsAllowList
parameter.
*
*
* @param queryStringsAllowList
* The specific query strings that the distribution forwards to the origin.
*
* Your distribution will cache content based on the specified query strings.
*
*
* If the option
parameter is true, then your distribution forwards all query strings,
* regardless of what you specify using the queryStringsAllowList
parameter.
*/
public void setQueryStringsAllowList(java.util.Collection queryStringsAllowList) {
if (queryStringsAllowList == null) {
this.queryStringsAllowList = null;
return;
}
this.queryStringsAllowList = new java.util.ArrayList(queryStringsAllowList);
}
/**
*
* The specific query strings that the distribution forwards to the origin.
*
*
* Your distribution will cache content based on the specified query strings.
*
*
* If the option
parameter is true, then your distribution forwards all query strings, regardless of
* what you specify using the queryStringsAllowList
parameter.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setQueryStringsAllowList(java.util.Collection)} or
* {@link #withQueryStringsAllowList(java.util.Collection)} if you want to override the existing values.
*
*
* @param queryStringsAllowList
* The specific query strings that the distribution forwards to the origin.
*
* Your distribution will cache content based on the specified query strings.
*
*
* If the option
parameter is true, then your distribution forwards all query strings,
* regardless of what you specify using the queryStringsAllowList
parameter.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QueryStringObject withQueryStringsAllowList(String... queryStringsAllowList) {
if (this.queryStringsAllowList == null) {
setQueryStringsAllowList(new java.util.ArrayList(queryStringsAllowList.length));
}
for (String ele : queryStringsAllowList) {
this.queryStringsAllowList.add(ele);
}
return this;
}
/**
*
* The specific query strings that the distribution forwards to the origin.
*
*
* Your distribution will cache content based on the specified query strings.
*
*
* If the option
parameter is true, then your distribution forwards all query strings, regardless of
* what you specify using the queryStringsAllowList
parameter.
*
*
* @param queryStringsAllowList
* The specific query strings that the distribution forwards to the origin.
*
* Your distribution will cache content based on the specified query strings.
*
*
* If the option
parameter is true, then your distribution forwards all query strings,
* regardless of what you specify using the queryStringsAllowList
parameter.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QueryStringObject withQueryStringsAllowList(java.util.Collection queryStringsAllowList) {
setQueryStringsAllowList(queryStringsAllowList);
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 (getOption() != null)
sb.append("Option: ").append(getOption()).append(",");
if (getQueryStringsAllowList() != null)
sb.append("QueryStringsAllowList: ").append(getQueryStringsAllowList());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof QueryStringObject == false)
return false;
QueryStringObject other = (QueryStringObject) obj;
if (other.getOption() == null ^ this.getOption() == null)
return false;
if (other.getOption() != null && other.getOption().equals(this.getOption()) == false)
return false;
if (other.getQueryStringsAllowList() == null ^ this.getQueryStringsAllowList() == null)
return false;
if (other.getQueryStringsAllowList() != null && other.getQueryStringsAllowList().equals(this.getQueryStringsAllowList()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getOption() == null) ? 0 : getOption().hashCode());
hashCode = prime * hashCode + ((getQueryStringsAllowList() == null) ? 0 : getQueryStringsAllowList().hashCode());
return hashCode;
}
@Override
public QueryStringObject clone() {
try {
return (QueryStringObject) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.lightsail.model.transform.QueryStringObjectMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}