com.amazonaws.services.ec2.model.VpnStaticRoute Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 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.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Describes a static route for a VPN connection.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class VpnStaticRoute implements Serializable, Cloneable {
/**
*
* The CIDR block associated with the local subnet of the customer data center.
*
*/
private String destinationCidrBlock;
/**
*
* Indicates how the routes were provided.
*
*/
private String source;
/**
*
* The current state of the static route.
*
*/
private String state;
/**
*
* The CIDR block associated with the local subnet of the customer data center.
*
*
* @param destinationCidrBlock
* The CIDR block associated with the local subnet of the customer data center.
*/
public void setDestinationCidrBlock(String destinationCidrBlock) {
this.destinationCidrBlock = destinationCidrBlock;
}
/**
*
* The CIDR block associated with the local subnet of the customer data center.
*
*
* @return The CIDR block associated with the local subnet of the customer data center.
*/
public String getDestinationCidrBlock() {
return this.destinationCidrBlock;
}
/**
*
* The CIDR block associated with the local subnet of the customer data center.
*
*
* @param destinationCidrBlock
* The CIDR block associated with the local subnet of the customer data center.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpnStaticRoute withDestinationCidrBlock(String destinationCidrBlock) {
setDestinationCidrBlock(destinationCidrBlock);
return this;
}
/**
*
* Indicates how the routes were provided.
*
*
* @param source
* Indicates how the routes were provided.
* @see VpnStaticRouteSource
*/
public void setSource(String source) {
this.source = source;
}
/**
*
* Indicates how the routes were provided.
*
*
* @return Indicates how the routes were provided.
* @see VpnStaticRouteSource
*/
public String getSource() {
return this.source;
}
/**
*
* Indicates how the routes were provided.
*
*
* @param source
* Indicates how the routes were provided.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VpnStaticRouteSource
*/
public VpnStaticRoute withSource(String source) {
setSource(source);
return this;
}
/**
*
* Indicates how the routes were provided.
*
*
* @param source
* Indicates how the routes were provided.
* @see VpnStaticRouteSource
*/
public void setSource(VpnStaticRouteSource source) {
withSource(source);
}
/**
*
* Indicates how the routes were provided.
*
*
* @param source
* Indicates how the routes were provided.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VpnStaticRouteSource
*/
public VpnStaticRoute withSource(VpnStaticRouteSource source) {
this.source = source.toString();
return this;
}
/**
*
* The current state of the static route.
*
*
* @param state
* The current state of the static route.
* @see VpnState
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The current state of the static route.
*
*
* @return The current state of the static route.
* @see VpnState
*/
public String getState() {
return this.state;
}
/**
*
* The current state of the static route.
*
*
* @param state
* The current state of the static route.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VpnState
*/
public VpnStaticRoute withState(String state) {
setState(state);
return this;
}
/**
*
* The current state of the static route.
*
*
* @param state
* The current state of the static route.
* @see VpnState
*/
public void setState(VpnState state) {
withState(state);
}
/**
*
* The current state of the static route.
*
*
* @param state
* The current state of the static route.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VpnState
*/
public VpnStaticRoute withState(VpnState state) {
this.state = state.toString();
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 (getDestinationCidrBlock() != null)
sb.append("DestinationCidrBlock: ").append(getDestinationCidrBlock()).append(",");
if (getSource() != null)
sb.append("Source: ").append(getSource()).append(",");
if (getState() != null)
sb.append("State: ").append(getState());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof VpnStaticRoute == false)
return false;
VpnStaticRoute other = (VpnStaticRoute) obj;
if (other.getDestinationCidrBlock() == null ^ this.getDestinationCidrBlock() == null)
return false;
if (other.getDestinationCidrBlock() != null && other.getDestinationCidrBlock().equals(this.getDestinationCidrBlock()) == false)
return false;
if (other.getSource() == null ^ this.getSource() == null)
return false;
if (other.getSource() != null && other.getSource().equals(this.getSource()) == false)
return false;
if (other.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDestinationCidrBlock() == null) ? 0 : getDestinationCidrBlock().hashCode());
hashCode = prime * hashCode + ((getSource() == null) ? 0 : getSource().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
return hashCode;
}
@Override
public VpnStaticRoute clone() {
try {
return (VpnStaticRoute) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}