com.amazonaws.services.ec2.model.PublicIpv4PoolRange Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 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.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Describes an address range of an IPv4 address pool.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PublicIpv4PoolRange implements Serializable, Cloneable {
/**
*
* The first IP address in the range.
*
*/
private String firstAddress;
/**
*
* The last IP address in the range.
*
*/
private String lastAddress;
/**
*
* The number of addresses in the range.
*
*/
private Integer addressCount;
/**
*
* The number of available addresses in the range.
*
*/
private Integer availableAddressCount;
/**
*
* The first IP address in the range.
*
*
* @param firstAddress
* The first IP address in the range.
*/
public void setFirstAddress(String firstAddress) {
this.firstAddress = firstAddress;
}
/**
*
* The first IP address in the range.
*
*
* @return The first IP address in the range.
*/
public String getFirstAddress() {
return this.firstAddress;
}
/**
*
* The first IP address in the range.
*
*
* @param firstAddress
* The first IP address in the range.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PublicIpv4PoolRange withFirstAddress(String firstAddress) {
setFirstAddress(firstAddress);
return this;
}
/**
*
* The last IP address in the range.
*
*
* @param lastAddress
* The last IP address in the range.
*/
public void setLastAddress(String lastAddress) {
this.lastAddress = lastAddress;
}
/**
*
* The last IP address in the range.
*
*
* @return The last IP address in the range.
*/
public String getLastAddress() {
return this.lastAddress;
}
/**
*
* The last IP address in the range.
*
*
* @param lastAddress
* The last IP address in the range.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PublicIpv4PoolRange withLastAddress(String lastAddress) {
setLastAddress(lastAddress);
return this;
}
/**
*
* The number of addresses in the range.
*
*
* @param addressCount
* The number of addresses in the range.
*/
public void setAddressCount(Integer addressCount) {
this.addressCount = addressCount;
}
/**
*
* The number of addresses in the range.
*
*
* @return The number of addresses in the range.
*/
public Integer getAddressCount() {
return this.addressCount;
}
/**
*
* The number of addresses in the range.
*
*
* @param addressCount
* The number of addresses in the range.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PublicIpv4PoolRange withAddressCount(Integer addressCount) {
setAddressCount(addressCount);
return this;
}
/**
*
* The number of available addresses in the range.
*
*
* @param availableAddressCount
* The number of available addresses in the range.
*/
public void setAvailableAddressCount(Integer availableAddressCount) {
this.availableAddressCount = availableAddressCount;
}
/**
*
* The number of available addresses in the range.
*
*
* @return The number of available addresses in the range.
*/
public Integer getAvailableAddressCount() {
return this.availableAddressCount;
}
/**
*
* The number of available addresses in the range.
*
*
* @param availableAddressCount
* The number of available addresses in the range.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PublicIpv4PoolRange withAvailableAddressCount(Integer availableAddressCount) {
setAvailableAddressCount(availableAddressCount);
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 (getFirstAddress() != null)
sb.append("FirstAddress: ").append(getFirstAddress()).append(",");
if (getLastAddress() != null)
sb.append("LastAddress: ").append(getLastAddress()).append(",");
if (getAddressCount() != null)
sb.append("AddressCount: ").append(getAddressCount()).append(",");
if (getAvailableAddressCount() != null)
sb.append("AvailableAddressCount: ").append(getAvailableAddressCount());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PublicIpv4PoolRange == false)
return false;
PublicIpv4PoolRange other = (PublicIpv4PoolRange) obj;
if (other.getFirstAddress() == null ^ this.getFirstAddress() == null)
return false;
if (other.getFirstAddress() != null && other.getFirstAddress().equals(this.getFirstAddress()) == false)
return false;
if (other.getLastAddress() == null ^ this.getLastAddress() == null)
return false;
if (other.getLastAddress() != null && other.getLastAddress().equals(this.getLastAddress()) == false)
return false;
if (other.getAddressCount() == null ^ this.getAddressCount() == null)
return false;
if (other.getAddressCount() != null && other.getAddressCount().equals(this.getAddressCount()) == false)
return false;
if (other.getAvailableAddressCount() == null ^ this.getAvailableAddressCount() == null)
return false;
if (other.getAvailableAddressCount() != null && other.getAvailableAddressCount().equals(this.getAvailableAddressCount()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getFirstAddress() == null) ? 0 : getFirstAddress().hashCode());
hashCode = prime * hashCode + ((getLastAddress() == null) ? 0 : getLastAddress().hashCode());
hashCode = prime * hashCode + ((getAddressCount() == null) ? 0 : getAddressCount().hashCode());
hashCode = prime * hashCode + ((getAvailableAddressCount() == null) ? 0 : getAvailableAddressCount().hashCode());
return hashCode;
}
@Override
public PublicIpv4PoolRange clone() {
try {
return (PublicIpv4PoolRange) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}