com.amazonaws.services.xray.model.Http Maven / Gradle / Ivy
Show all versions of aws-java-sdk-xray Show documentation
/*
* Copyright 2016-2021 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.xray.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about an HTTP request.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Http implements Serializable, Cloneable, StructuredPojo {
/**
*
* The request URL.
*
*/
private String httpURL;
/**
*
* The response status.
*
*/
private Integer httpStatus;
/**
*
* The request method.
*
*/
private String httpMethod;
/**
*
* The request's user agent string.
*
*/
private String userAgent;
/**
*
* The IP address of the requestor.
*
*/
private String clientIp;
/**
*
* The request URL.
*
*
* @param httpURL
* The request URL.
*/
public void setHttpURL(String httpURL) {
this.httpURL = httpURL;
}
/**
*
* The request URL.
*
*
* @return The request URL.
*/
public String getHttpURL() {
return this.httpURL;
}
/**
*
* The request URL.
*
*
* @param httpURL
* The request URL.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Http withHttpURL(String httpURL) {
setHttpURL(httpURL);
return this;
}
/**
*
* The response status.
*
*
* @param httpStatus
* The response status.
*/
public void setHttpStatus(Integer httpStatus) {
this.httpStatus = httpStatus;
}
/**
*
* The response status.
*
*
* @return The response status.
*/
public Integer getHttpStatus() {
return this.httpStatus;
}
/**
*
* The response status.
*
*
* @param httpStatus
* The response status.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Http withHttpStatus(Integer httpStatus) {
setHttpStatus(httpStatus);
return this;
}
/**
*
* The request method.
*
*
* @param httpMethod
* The request method.
*/
public void setHttpMethod(String httpMethod) {
this.httpMethod = httpMethod;
}
/**
*
* The request method.
*
*
* @return The request method.
*/
public String getHttpMethod() {
return this.httpMethod;
}
/**
*
* The request method.
*
*
* @param httpMethod
* The request method.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Http withHttpMethod(String httpMethod) {
setHttpMethod(httpMethod);
return this;
}
/**
*
* The request's user agent string.
*
*
* @param userAgent
* The request's user agent string.
*/
public void setUserAgent(String userAgent) {
this.userAgent = userAgent;
}
/**
*
* The request's user agent string.
*
*
* @return The request's user agent string.
*/
public String getUserAgent() {
return this.userAgent;
}
/**
*
* The request's user agent string.
*
*
* @param userAgent
* The request's user agent string.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Http withUserAgent(String userAgent) {
setUserAgent(userAgent);
return this;
}
/**
*
* The IP address of the requestor.
*
*
* @param clientIp
* The IP address of the requestor.
*/
public void setClientIp(String clientIp) {
this.clientIp = clientIp;
}
/**
*
* The IP address of the requestor.
*
*
* @return The IP address of the requestor.
*/
public String getClientIp() {
return this.clientIp;
}
/**
*
* The IP address of the requestor.
*
*
* @param clientIp
* The IP address of the requestor.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Http withClientIp(String clientIp) {
setClientIp(clientIp);
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 (getHttpURL() != null)
sb.append("HttpURL: ").append(getHttpURL()).append(",");
if (getHttpStatus() != null)
sb.append("HttpStatus: ").append(getHttpStatus()).append(",");
if (getHttpMethod() != null)
sb.append("HttpMethod: ").append(getHttpMethod()).append(",");
if (getUserAgent() != null)
sb.append("UserAgent: ").append(getUserAgent()).append(",");
if (getClientIp() != null)
sb.append("ClientIp: ").append(getClientIp());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Http == false)
return false;
Http other = (Http) obj;
if (other.getHttpURL() == null ^ this.getHttpURL() == null)
return false;
if (other.getHttpURL() != null && other.getHttpURL().equals(this.getHttpURL()) == false)
return false;
if (other.getHttpStatus() == null ^ this.getHttpStatus() == null)
return false;
if (other.getHttpStatus() != null && other.getHttpStatus().equals(this.getHttpStatus()) == false)
return false;
if (other.getHttpMethod() == null ^ this.getHttpMethod() == null)
return false;
if (other.getHttpMethod() != null && other.getHttpMethod().equals(this.getHttpMethod()) == false)
return false;
if (other.getUserAgent() == null ^ this.getUserAgent() == null)
return false;
if (other.getUserAgent() != null && other.getUserAgent().equals(this.getUserAgent()) == false)
return false;
if (other.getClientIp() == null ^ this.getClientIp() == null)
return false;
if (other.getClientIp() != null && other.getClientIp().equals(this.getClientIp()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getHttpURL() == null) ? 0 : getHttpURL().hashCode());
hashCode = prime * hashCode + ((getHttpStatus() == null) ? 0 : getHttpStatus().hashCode());
hashCode = prime * hashCode + ((getHttpMethod() == null) ? 0 : getHttpMethod().hashCode());
hashCode = prime * hashCode + ((getUserAgent() == null) ? 0 : getUserAgent().hashCode());
hashCode = prime * hashCode + ((getClientIp() == null) ? 0 : getClientIp().hashCode());
return hashCode;
}
@Override
public Http clone() {
try {
return (Http) 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.xray.model.transform.HttpMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}