com.amazonaws.services.drs.model.NetworkInterface Maven / Gradle / Ivy
Show all versions of aws-java-sdk-drs 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.drs.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Network interface.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class NetworkInterface implements Serializable, Cloneable, StructuredPojo {
/**
*
* Network interface IPs.
*
*/
private java.util.List ips;
/**
*
* Whether this is the primary network interface.
*
*/
private Boolean isPrimary;
/**
*
* The MAC address of the network interface.
*
*/
private String macAddress;
/**
*
* Network interface IPs.
*
*
* @return Network interface IPs.
*/
public java.util.List getIps() {
return ips;
}
/**
*
* Network interface IPs.
*
*
* @param ips
* Network interface IPs.
*/
public void setIps(java.util.Collection ips) {
if (ips == null) {
this.ips = null;
return;
}
this.ips = new java.util.ArrayList(ips);
}
/**
*
* Network interface IPs.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setIps(java.util.Collection)} or {@link #withIps(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param ips
* Network interface IPs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkInterface withIps(String... ips) {
if (this.ips == null) {
setIps(new java.util.ArrayList(ips.length));
}
for (String ele : ips) {
this.ips.add(ele);
}
return this;
}
/**
*
* Network interface IPs.
*
*
* @param ips
* Network interface IPs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkInterface withIps(java.util.Collection ips) {
setIps(ips);
return this;
}
/**
*
* Whether this is the primary network interface.
*
*
* @param isPrimary
* Whether this is the primary network interface.
*/
public void setIsPrimary(Boolean isPrimary) {
this.isPrimary = isPrimary;
}
/**
*
* Whether this is the primary network interface.
*
*
* @return Whether this is the primary network interface.
*/
public Boolean getIsPrimary() {
return this.isPrimary;
}
/**
*
* Whether this is the primary network interface.
*
*
* @param isPrimary
* Whether this is the primary network interface.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkInterface withIsPrimary(Boolean isPrimary) {
setIsPrimary(isPrimary);
return this;
}
/**
*
* Whether this is the primary network interface.
*
*
* @return Whether this is the primary network interface.
*/
public Boolean isPrimary() {
return this.isPrimary;
}
/**
*
* The MAC address of the network interface.
*
*
* @param macAddress
* The MAC address of the network interface.
*/
public void setMacAddress(String macAddress) {
this.macAddress = macAddress;
}
/**
*
* The MAC address of the network interface.
*
*
* @return The MAC address of the network interface.
*/
public String getMacAddress() {
return this.macAddress;
}
/**
*
* The MAC address of the network interface.
*
*
* @param macAddress
* The MAC address of the network interface.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkInterface withMacAddress(String macAddress) {
setMacAddress(macAddress);
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 (getIps() != null)
sb.append("Ips: ").append(getIps()).append(",");
if (getIsPrimary() != null)
sb.append("IsPrimary: ").append(getIsPrimary()).append(",");
if (getMacAddress() != null)
sb.append("MacAddress: ").append(getMacAddress());
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.getIps() == null ^ this.getIps() == null)
return false;
if (other.getIps() != null && other.getIps().equals(this.getIps()) == false)
return false;
if (other.getIsPrimary() == null ^ this.getIsPrimary() == null)
return false;
if (other.getIsPrimary() != null && other.getIsPrimary().equals(this.getIsPrimary()) == false)
return false;
if (other.getMacAddress() == null ^ this.getMacAddress() == null)
return false;
if (other.getMacAddress() != null && other.getMacAddress().equals(this.getMacAddress()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getIps() == null) ? 0 : getIps().hashCode());
hashCode = prime * hashCode + ((getIsPrimary() == null) ? 0 : getIsPrimary().hashCode());
hashCode = prime * hashCode + ((getMacAddress() == null) ? 0 : getMacAddress().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.drs.model.transform.NetworkInterfaceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}