com.amazonaws.services.elasticloadbalancingv2.model.FixedResponseActionConfig Maven / Gradle / Ivy
Show all versions of aws-java-sdk-elasticloadbalancingv2 Show documentation
/*
* Copyright 2019-2024 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.elasticloadbalancingv2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Information about an action that returns a custom HTTP response.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class FixedResponseActionConfig implements Serializable, Cloneable {
/**
*
* The message.
*
*/
private String messageBody;
/**
*
* The HTTP response code (2XX, 4XX, or 5XX).
*
*/
private String statusCode;
/**
*
* The content type.
*
*
* Valid Values: text/plain | text/css | text/html | application/javascript | application/json
*
*/
private String contentType;
/**
*
* The message.
*
*
* @param messageBody
* The message.
*/
public void setMessageBody(String messageBody) {
this.messageBody = messageBody;
}
/**
*
* The message.
*
*
* @return The message.
*/
public String getMessageBody() {
return this.messageBody;
}
/**
*
* The message.
*
*
* @param messageBody
* The message.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FixedResponseActionConfig withMessageBody(String messageBody) {
setMessageBody(messageBody);
return this;
}
/**
*
* The HTTP response code (2XX, 4XX, or 5XX).
*
*
* @param statusCode
* The HTTP response code (2XX, 4XX, or 5XX).
*/
public void setStatusCode(String statusCode) {
this.statusCode = statusCode;
}
/**
*
* The HTTP response code (2XX, 4XX, or 5XX).
*
*
* @return The HTTP response code (2XX, 4XX, or 5XX).
*/
public String getStatusCode() {
return this.statusCode;
}
/**
*
* The HTTP response code (2XX, 4XX, or 5XX).
*
*
* @param statusCode
* The HTTP response code (2XX, 4XX, or 5XX).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FixedResponseActionConfig withStatusCode(String statusCode) {
setStatusCode(statusCode);
return this;
}
/**
*
* The content type.
*
*
* Valid Values: text/plain | text/css | text/html | application/javascript | application/json
*
*
* @param contentType
* The content type.
*
* Valid Values: text/plain | text/css | text/html | application/javascript | application/json
*/
public void setContentType(String contentType) {
this.contentType = contentType;
}
/**
*
* The content type.
*
*
* Valid Values: text/plain | text/css | text/html | application/javascript | application/json
*
*
* @return The content type.
*
* Valid Values: text/plain | text/css | text/html | application/javascript | application/json
*/
public String getContentType() {
return this.contentType;
}
/**
*
* The content type.
*
*
* Valid Values: text/plain | text/css | text/html | application/javascript | application/json
*
*
* @param contentType
* The content type.
*
* Valid Values: text/plain | text/css | text/html | application/javascript | application/json
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FixedResponseActionConfig withContentType(String contentType) {
setContentType(contentType);
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 (getMessageBody() != null)
sb.append("MessageBody: ").append(getMessageBody()).append(",");
if (getStatusCode() != null)
sb.append("StatusCode: ").append(getStatusCode()).append(",");
if (getContentType() != null)
sb.append("ContentType: ").append(getContentType());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof FixedResponseActionConfig == false)
return false;
FixedResponseActionConfig other = (FixedResponseActionConfig) obj;
if (other.getMessageBody() == null ^ this.getMessageBody() == null)
return false;
if (other.getMessageBody() != null && other.getMessageBody().equals(this.getMessageBody()) == false)
return false;
if (other.getStatusCode() == null ^ this.getStatusCode() == null)
return false;
if (other.getStatusCode() != null && other.getStatusCode().equals(this.getStatusCode()) == false)
return false;
if (other.getContentType() == null ^ this.getContentType() == null)
return false;
if (other.getContentType() != null && other.getContentType().equals(this.getContentType()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getMessageBody() == null) ? 0 : getMessageBody().hashCode());
hashCode = prime * hashCode + ((getStatusCode() == null) ? 0 : getStatusCode().hashCode());
hashCode = prime * hashCode + ((getContentType() == null) ? 0 : getContentType().hashCode());
return hashCode;
}
@Override
public FixedResponseActionConfig clone() {
try {
return (FixedResponseActionConfig) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}