/* * 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.appmesh.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* An object that represents an HTTP or HTTP/2 route type. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class HttpRoute implements Serializable, Cloneable, StructuredPojo { /** ** An object that represents the action to take if a match is determined. *
*/ private HttpRouteAction action; /** ** An object that represents the criteria for determining a request match. *
*/ private HttpRouteMatch match; /** ** An object that represents a retry policy. *
*/ private HttpRetryPolicy retryPolicy; /** ** An object that represents types of timeouts. *
*/ private HttpTimeout timeout; /** ** An object that represents the action to take if a match is determined. *
* * @param action * An object that represents the action to take if a match is determined. */ public void setAction(HttpRouteAction action) { this.action = action; } /** ** An object that represents the action to take if a match is determined. *
* * @return An object that represents the action to take if a match is determined. */ public HttpRouteAction getAction() { return this.action; } /** ** An object that represents the action to take if a match is determined. *
* * @param action * An object that represents the action to take if a match is determined. * @return Returns a reference to this object so that method calls can be chained together. */ public HttpRoute withAction(HttpRouteAction action) { setAction(action); return this; } /** ** An object that represents the criteria for determining a request match. *
* * @param match * An object that represents the criteria for determining a request match. */ public void setMatch(HttpRouteMatch match) { this.match = match; } /** ** An object that represents the criteria for determining a request match. *
* * @return An object that represents the criteria for determining a request match. */ public HttpRouteMatch getMatch() { return this.match; } /** ** An object that represents the criteria for determining a request match. *
* * @param match * An object that represents the criteria for determining a request match. * @return Returns a reference to this object so that method calls can be chained together. */ public HttpRoute withMatch(HttpRouteMatch match) { setMatch(match); return this; } /** ** An object that represents a retry policy. *
* * @param retryPolicy * An object that represents a retry policy. */ public void setRetryPolicy(HttpRetryPolicy retryPolicy) { this.retryPolicy = retryPolicy; } /** ** An object that represents a retry policy. *
* * @return An object that represents a retry policy. */ public HttpRetryPolicy getRetryPolicy() { return this.retryPolicy; } /** ** An object that represents a retry policy. *
* * @param retryPolicy * An object that represents a retry policy. * @return Returns a reference to this object so that method calls can be chained together. */ public HttpRoute withRetryPolicy(HttpRetryPolicy retryPolicy) { setRetryPolicy(retryPolicy); return this; } /** ** An object that represents types of timeouts. *
* * @param timeout * An object that represents types of timeouts. */ public void setTimeout(HttpTimeout timeout) { this.timeout = timeout; } /** ** An object that represents types of timeouts. *
* * @return An object that represents types of timeouts. */ public HttpTimeout getTimeout() { return this.timeout; } /** ** An object that represents types of timeouts. *
* * @param timeout * An object that represents types of timeouts. * @return Returns a reference to this object so that method calls can be chained together. */ public HttpRoute withTimeout(HttpTimeout timeout) { setTimeout(timeout); 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 (getAction() != null) sb.append("Action: ").append(getAction()).append(","); if (getMatch() != null) sb.append("Match: ").append(getMatch()).append(","); if (getRetryPolicy() != null) sb.append("RetryPolicy: ").append(getRetryPolicy()).append(","); if (getTimeout() != null) sb.append("Timeout: ").append(getTimeout()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof HttpRoute == false) return false; HttpRoute other = (HttpRoute) obj; if (other.getAction() == null ^ this.getAction() == null) return false; if (other.getAction() != null && other.getAction().equals(this.getAction()) == false) return false; if (other.getMatch() == null ^ this.getMatch() == null) return false; if (other.getMatch() != null && other.getMatch().equals(this.getMatch()) == false) return false; if (other.getRetryPolicy() == null ^ this.getRetryPolicy() == null) return false; if (other.getRetryPolicy() != null && other.getRetryPolicy().equals(this.getRetryPolicy()) == false) return false; if (other.getTimeout() == null ^ this.getTimeout() == null) return false; if (other.getTimeout() != null && other.getTimeout().equals(this.getTimeout()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAction() == null) ? 0 : getAction().hashCode()); hashCode = prime * hashCode + ((getMatch() == null) ? 0 : getMatch().hashCode()); hashCode = prime * hashCode + ((getRetryPolicy() == null) ? 0 : getRetryPolicy().hashCode()); hashCode = prime * hashCode + ((getTimeout() == null) ? 0 : getTimeout().hashCode()); return hashCode; } @Override public HttpRoute clone() { try { return (HttpRoute) 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.appmesh.model.transform.HttpRouteMarshaller.getInstance().marshall(this, protocolMarshaller); } }