com.amazonaws.services.storagegateway.model.NetworkInterface Maven / Gradle / Ivy
Show all versions of aws-java-sdk-storagegateway Show documentation
/*
* Copyright 2015-2020 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.storagegateway.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes a gateway's network interface.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class NetworkInterface implements Serializable, Cloneable, StructuredPojo {
/**
*
* The Internet Protocol version 4 (IPv4) address of the interface.
*
*/
private String ipv4Address;
/**
*
* The Media Access Control (MAC) address of the interface.
*
*
*
* This is currently unsupported and will not be returned in output.
*
*
*/
private String macAddress;
/**
*
* The Internet Protocol version 6 (IPv6) address of the interface. Currently not supported.
*
*/
private String ipv6Address;
/**
*
* The Internet Protocol version 4 (IPv4) address of the interface.
*
*
* @param ipv4Address
* The Internet Protocol version 4 (IPv4) address of the interface.
*/
public void setIpv4Address(String ipv4Address) {
this.ipv4Address = ipv4Address;
}
/**
*
* The Internet Protocol version 4 (IPv4) address of the interface.
*
*
* @return The Internet Protocol version 4 (IPv4) address of the interface.
*/
public String getIpv4Address() {
return this.ipv4Address;
}
/**
*
* The Internet Protocol version 4 (IPv4) address of the interface.
*
*
* @param ipv4Address
* The Internet Protocol version 4 (IPv4) address of the interface.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkInterface withIpv4Address(String ipv4Address) {
setIpv4Address(ipv4Address);
return this;
}
/**
*
* The Media Access Control (MAC) address of the interface.
*
*
*
* This is currently unsupported and will not be returned in output.
*
*
*
* @param macAddress
* The Media Access Control (MAC) address of the interface.
*
* This is currently unsupported and will not be returned in output.
*
*/
public void setMacAddress(String macAddress) {
this.macAddress = macAddress;
}
/**
*
* The Media Access Control (MAC) address of the interface.
*
*
*
* This is currently unsupported and will not be returned in output.
*
*
*
* @return The Media Access Control (MAC) address of the interface.
*
* This is currently unsupported and will not be returned in output.
*
*/
public String getMacAddress() {
return this.macAddress;
}
/**
*
* The Media Access Control (MAC) address of the interface.
*
*
*
* This is currently unsupported and will not be returned in output.
*
*
*
* @param macAddress
* The Media Access Control (MAC) address of the interface.
*
* This is currently unsupported and will not be returned in output.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkInterface withMacAddress(String macAddress) {
setMacAddress(macAddress);
return this;
}
/**
*
* The Internet Protocol version 6 (IPv6) address of the interface. Currently not supported.
*
*
* @param ipv6Address
* The Internet Protocol version 6 (IPv6) address of the interface. Currently not supported.
*/
public void setIpv6Address(String ipv6Address) {
this.ipv6Address = ipv6Address;
}
/**
*
* The Internet Protocol version 6 (IPv6) address of the interface. Currently not supported.
*
*
* @return The Internet Protocol version 6 (IPv6) address of the interface. Currently not supported.
*/
public String getIpv6Address() {
return this.ipv6Address;
}
/**
*
* The Internet Protocol version 6 (IPv6) address of the interface. Currently not supported.
*
*
* @param ipv6Address
* The Internet Protocol version 6 (IPv6) address of the interface. Currently not supported.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkInterface withIpv6Address(String ipv6Address) {
setIpv6Address(ipv6Address);
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 (getIpv4Address() != null)
sb.append("Ipv4Address: ").append(getIpv4Address()).append(",");
if (getMacAddress() != null)
sb.append("MacAddress: ").append(getMacAddress()).append(",");
if (getIpv6Address() != null)
sb.append("Ipv6Address: ").append(getIpv6Address());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof NetworkInterface == false)
return false;
NetworkInterface other = (NetworkInterface) obj;
if (other.getIpv4Address() == null ^ this.getIpv4Address() == null)
return false;
if (other.getIpv4Address() != null && other.getIpv4Address().equals(this.getIpv4Address()) == false)
return false;
if (other.getMacAddress() == null ^ this.getMacAddress() == null)
return false;
if (other.getMacAddress() != null && other.getMacAddress().equals(this.getMacAddress()) == false)
return false;
if (other.getIpv6Address() == null ^ this.getIpv6Address() == null)
return false;
if (other.getIpv6Address() != null && other.getIpv6Address().equals(this.getIpv6Address()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getIpv4Address() == null) ? 0 : getIpv4Address().hashCode());
hashCode = prime * hashCode + ((getMacAddress() == null) ? 0 : getMacAddress().hashCode());
hashCode = prime * hashCode + ((getIpv6Address() == null) ? 0 : getIpv6Address().hashCode());
return hashCode;
}
@Override
public NetworkInterface clone() {
try {
return (NetworkInterface) 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.storagegateway.model.transform.NetworkInterfaceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}