/* * 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.drs.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Properties of the Source Server machine. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SourceProperties implements Serializable, Cloneable, StructuredPojo { /** ** An array of CPUs. *
*/ private java.util.List* An array of disks. *
*/ private java.util.List* Hints used to uniquely identify a machine. *
*/ private IdentificationHints identificationHints; /** ** The date and time the Source Properties were last updated on. *
*/ private String lastUpdatedDateTime; /** ** An array of network interfaces. *
*/ private java.util.List* Operating system. *
*/ private OS os; /** ** The amount of RAM in bytes. *
*/ private Long ramBytes; /** ** The recommended EC2 instance type that will be used when recovering the Source Server. *
*/ private String recommendedInstanceType; /** ** Are EC2 nitro instance types supported when recovering the Source Server. *
*/ private Boolean supportsNitroInstances; /** ** An array of CPUs. *
* * @return An array of CPUs. */ public java.util.List* An array of CPUs. *
* * @param cpus * An array of CPUs. */ public void setCpus(java.util.Collection* An array of CPUs. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setCpus(java.util.Collection)} or {@link #withCpus(java.util.Collection)} if you want to override the * existing values. *
* * @param cpus * An array of CPUs. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceProperties withCpus(CPU... cpus) { if (this.cpus == null) { setCpus(new java.util.ArrayList* An array of CPUs. *
* * @param cpus * An array of CPUs. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceProperties withCpus(java.util.Collection* An array of disks. *
* * @return An array of disks. */ public java.util.List* An array of disks. *
* * @param disks * An array of disks. */ public void setDisks(java.util.Collection* An array of disks. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setDisks(java.util.Collection)} or {@link #withDisks(java.util.Collection)} if you want to override the * existing values. *
* * @param disks * An array of disks. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceProperties withDisks(Disk... disks) { if (this.disks == null) { setDisks(new java.util.ArrayList* An array of disks. *
* * @param disks * An array of disks. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceProperties withDisks(java.util.Collection* Hints used to uniquely identify a machine. *
* * @param identificationHints * Hints used to uniquely identify a machine. */ public void setIdentificationHints(IdentificationHints identificationHints) { this.identificationHints = identificationHints; } /** ** Hints used to uniquely identify a machine. *
* * @return Hints used to uniquely identify a machine. */ public IdentificationHints getIdentificationHints() { return this.identificationHints; } /** ** Hints used to uniquely identify a machine. *
* * @param identificationHints * Hints used to uniquely identify a machine. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceProperties withIdentificationHints(IdentificationHints identificationHints) { setIdentificationHints(identificationHints); return this; } /** ** The date and time the Source Properties were last updated on. *
* * @param lastUpdatedDateTime * The date and time the Source Properties were last updated on. */ public void setLastUpdatedDateTime(String lastUpdatedDateTime) { this.lastUpdatedDateTime = lastUpdatedDateTime; } /** ** The date and time the Source Properties were last updated on. *
* * @return The date and time the Source Properties were last updated on. */ public String getLastUpdatedDateTime() { return this.lastUpdatedDateTime; } /** ** The date and time the Source Properties were last updated on. *
* * @param lastUpdatedDateTime * The date and time the Source Properties were last updated on. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceProperties withLastUpdatedDateTime(String lastUpdatedDateTime) { setLastUpdatedDateTime(lastUpdatedDateTime); return this; } /** ** An array of network interfaces. *
* * @return An array of network interfaces. */ public java.util.List* An array of network interfaces. *
* * @param networkInterfaces * An array of network interfaces. */ public void setNetworkInterfaces(java.util.Collection* An array of network interfaces. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setNetworkInterfaces(java.util.Collection)} or {@link #withNetworkInterfaces(java.util.Collection)} if * you want to override the existing values. *
* * @param networkInterfaces * An array of network interfaces. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceProperties withNetworkInterfaces(NetworkInterface... networkInterfaces) { if (this.networkInterfaces == null) { setNetworkInterfaces(new java.util.ArrayList* An array of network interfaces. *
* * @param networkInterfaces * An array of network interfaces. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceProperties withNetworkInterfaces(java.util.Collection* Operating system. *
* * @param os * Operating system. */ public void setOs(OS os) { this.os = os; } /** ** Operating system. *
* * @return Operating system. */ public OS getOs() { return this.os; } /** ** Operating system. *
* * @param os * Operating system. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceProperties withOs(OS os) { setOs(os); return this; } /** ** The amount of RAM in bytes. *
* * @param ramBytes * The amount of RAM in bytes. */ public void setRamBytes(Long ramBytes) { this.ramBytes = ramBytes; } /** ** The amount of RAM in bytes. *
* * @return The amount of RAM in bytes. */ public Long getRamBytes() { return this.ramBytes; } /** ** The amount of RAM in bytes. *
* * @param ramBytes * The amount of RAM in bytes. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceProperties withRamBytes(Long ramBytes) { setRamBytes(ramBytes); return this; } /** ** The recommended EC2 instance type that will be used when recovering the Source Server. *
* * @param recommendedInstanceType * The recommended EC2 instance type that will be used when recovering the Source Server. */ public void setRecommendedInstanceType(String recommendedInstanceType) { this.recommendedInstanceType = recommendedInstanceType; } /** ** The recommended EC2 instance type that will be used when recovering the Source Server. *
* * @return The recommended EC2 instance type that will be used when recovering the Source Server. */ public String getRecommendedInstanceType() { return this.recommendedInstanceType; } /** ** The recommended EC2 instance type that will be used when recovering the Source Server. *
* * @param recommendedInstanceType * The recommended EC2 instance type that will be used when recovering the Source Server. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceProperties withRecommendedInstanceType(String recommendedInstanceType) { setRecommendedInstanceType(recommendedInstanceType); return this; } /** ** Are EC2 nitro instance types supported when recovering the Source Server. *
* * @param supportsNitroInstances * Are EC2 nitro instance types supported when recovering the Source Server. */ public void setSupportsNitroInstances(Boolean supportsNitroInstances) { this.supportsNitroInstances = supportsNitroInstances; } /** ** Are EC2 nitro instance types supported when recovering the Source Server. *
* * @return Are EC2 nitro instance types supported when recovering the Source Server. */ public Boolean getSupportsNitroInstances() { return this.supportsNitroInstances; } /** ** Are EC2 nitro instance types supported when recovering the Source Server. *
* * @param supportsNitroInstances * Are EC2 nitro instance types supported when recovering the Source Server. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceProperties withSupportsNitroInstances(Boolean supportsNitroInstances) { setSupportsNitroInstances(supportsNitroInstances); return this; } /** ** Are EC2 nitro instance types supported when recovering the Source Server. *
* * @return Are EC2 nitro instance types supported when recovering the Source Server. */ public Boolean isSupportsNitroInstances() { return this.supportsNitroInstances; } /** * 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 (getCpus() != null) sb.append("Cpus: ").append(getCpus()).append(","); if (getDisks() != null) sb.append("Disks: ").append(getDisks()).append(","); if (getIdentificationHints() != null) sb.append("IdentificationHints: ").append(getIdentificationHints()).append(","); if (getLastUpdatedDateTime() != null) sb.append("LastUpdatedDateTime: ").append(getLastUpdatedDateTime()).append(","); if (getNetworkInterfaces() != null) sb.append("NetworkInterfaces: ").append(getNetworkInterfaces()).append(","); if (getOs() != null) sb.append("Os: ").append(getOs()).append(","); if (getRamBytes() != null) sb.append("RamBytes: ").append(getRamBytes()).append(","); if (getRecommendedInstanceType() != null) sb.append("RecommendedInstanceType: ").append(getRecommendedInstanceType()).append(","); if (getSupportsNitroInstances() != null) sb.append("SupportsNitroInstances: ").append(getSupportsNitroInstances()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SourceProperties == false) return false; SourceProperties other = (SourceProperties) obj; if (other.getCpus() == null ^ this.getCpus() == null) return false; if (other.getCpus() != null && other.getCpus().equals(this.getCpus()) == false) return false; if (other.getDisks() == null ^ this.getDisks() == null) return false; if (other.getDisks() != null && other.getDisks().equals(this.getDisks()) == false) return false; if (other.getIdentificationHints() == null ^ this.getIdentificationHints() == null) return false; if (other.getIdentificationHints() != null && other.getIdentificationHints().equals(this.getIdentificationHints()) == false) return false; if (other.getLastUpdatedDateTime() == null ^ this.getLastUpdatedDateTime() == null) return false; if (other.getLastUpdatedDateTime() != null && other.getLastUpdatedDateTime().equals(this.getLastUpdatedDateTime()) == false) return false; if (other.getNetworkInterfaces() == null ^ this.getNetworkInterfaces() == null) return false; if (other.getNetworkInterfaces() != null && other.getNetworkInterfaces().equals(this.getNetworkInterfaces()) == false) return false; if (other.getOs() == null ^ this.getOs() == null) return false; if (other.getOs() != null && other.getOs().equals(this.getOs()) == false) return false; if (other.getRamBytes() == null ^ this.getRamBytes() == null) return false; if (other.getRamBytes() != null && other.getRamBytes().equals(this.getRamBytes()) == false) return false; if (other.getRecommendedInstanceType() == null ^ this.getRecommendedInstanceType() == null) return false; if (other.getRecommendedInstanceType() != null && other.getRecommendedInstanceType().equals(this.getRecommendedInstanceType()) == false) return false; if (other.getSupportsNitroInstances() == null ^ this.getSupportsNitroInstances() == null) return false; if (other.getSupportsNitroInstances() != null && other.getSupportsNitroInstances().equals(this.getSupportsNitroInstances()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCpus() == null) ? 0 : getCpus().hashCode()); hashCode = prime * hashCode + ((getDisks() == null) ? 0 : getDisks().hashCode()); hashCode = prime * hashCode + ((getIdentificationHints() == null) ? 0 : getIdentificationHints().hashCode()); hashCode = prime * hashCode + ((getLastUpdatedDateTime() == null) ? 0 : getLastUpdatedDateTime().hashCode()); hashCode = prime * hashCode + ((getNetworkInterfaces() == null) ? 0 : getNetworkInterfaces().hashCode()); hashCode = prime * hashCode + ((getOs() == null) ? 0 : getOs().hashCode()); hashCode = prime * hashCode + ((getRamBytes() == null) ? 0 : getRamBytes().hashCode()); hashCode = prime * hashCode + ((getRecommendedInstanceType() == null) ? 0 : getRecommendedInstanceType().hashCode()); hashCode = prime * hashCode + ((getSupportsNitroInstances() == null) ? 0 : getSupportsNitroInstances().hashCode()); return hashCode; } @Override public SourceProperties clone() { try { return (SourceProperties) 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.SourcePropertiesMarshaller.getInstance().marshall(this, protocolMarshaller); } }