
com.amazonaws.services.opsworks.model.OperatingSystem Maven / Gradle / Ivy
/*
* Copyright 2013-2018 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.opsworks.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes supported operating systems in AWS OpsWorks Stacks.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class OperatingSystem implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the operating system, such as Amazon Linux 2017.09
.
*
*/
private String name;
/**
*
* The ID of a supported operating system, such as Amazon Linux 2017.09
.
*
*/
private String id;
/**
*
* The type of a supported operating system, either Linux
or Windows
.
*
*/
private String type;
/**
*
* Supported configuration manager name and versions for an AWS OpsWorks Stacks operating system.
*
*/
private com.amazonaws.internal.SdkInternalList configurationManagers;
/**
*
* A short name for the operating system manufacturer.
*
*/
private String reportedName;
/**
*
* The version of the operating system, including the release and edition, if applicable.
*
*/
private String reportedVersion;
/**
*
* Indicates that an operating system is not supported for new instances.
*
*/
private Boolean supported;
/**
*
* The name of the operating system, such as Amazon Linux 2017.09
.
*
*
* @param name
* The name of the operating system, such as Amazon Linux 2017.09
.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the operating system, such as Amazon Linux 2017.09
.
*
*
* @return The name of the operating system, such as Amazon Linux 2017.09
.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the operating system, such as Amazon Linux 2017.09
.
*
*
* @param name
* The name of the operating system, such as Amazon Linux 2017.09
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OperatingSystem withName(String name) {
setName(name);
return this;
}
/**
*
* The ID of a supported operating system, such as Amazon Linux 2017.09
.
*
*
* @param id
* The ID of a supported operating system, such as Amazon Linux 2017.09
.
*/
public void setId(String id) {
this.id = id;
}
/**
*
* The ID of a supported operating system, such as Amazon Linux 2017.09
.
*
*
* @return The ID of a supported operating system, such as Amazon Linux 2017.09
.
*/
public String getId() {
return this.id;
}
/**
*
* The ID of a supported operating system, such as Amazon Linux 2017.09
.
*
*
* @param id
* The ID of a supported operating system, such as Amazon Linux 2017.09
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OperatingSystem withId(String id) {
setId(id);
return this;
}
/**
*
* The type of a supported operating system, either Linux
or Windows
.
*
*
* @param type
* The type of a supported operating system, either Linux
or Windows
.
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The type of a supported operating system, either Linux
or Windows
.
*
*
* @return The type of a supported operating system, either Linux
or Windows
.
*/
public String getType() {
return this.type;
}
/**
*
* The type of a supported operating system, either Linux
or Windows
.
*
*
* @param type
* The type of a supported operating system, either Linux
or Windows
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OperatingSystem withType(String type) {
setType(type);
return this;
}
/**
*
* Supported configuration manager name and versions for an AWS OpsWorks Stacks operating system.
*
*
* @return Supported configuration manager name and versions for an AWS OpsWorks Stacks operating system.
*/
public java.util.List getConfigurationManagers() {
if (configurationManagers == null) {
configurationManagers = new com.amazonaws.internal.SdkInternalList();
}
return configurationManagers;
}
/**
*
* Supported configuration manager name and versions for an AWS OpsWorks Stacks operating system.
*
*
* @param configurationManagers
* Supported configuration manager name and versions for an AWS OpsWorks Stacks operating system.
*/
public void setConfigurationManagers(java.util.Collection configurationManagers) {
if (configurationManagers == null) {
this.configurationManagers = null;
return;
}
this.configurationManagers = new com.amazonaws.internal.SdkInternalList(configurationManagers);
}
/**
*
* Supported configuration manager name and versions for an AWS OpsWorks Stacks operating system.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setConfigurationManagers(java.util.Collection)} or
* {@link #withConfigurationManagers(java.util.Collection)} if you want to override the existing values.
*
*
* @param configurationManagers
* Supported configuration manager name and versions for an AWS OpsWorks Stacks operating system.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OperatingSystem withConfigurationManagers(OperatingSystemConfigurationManager... configurationManagers) {
if (this.configurationManagers == null) {
setConfigurationManagers(new com.amazonaws.internal.SdkInternalList(configurationManagers.length));
}
for (OperatingSystemConfigurationManager ele : configurationManagers) {
this.configurationManagers.add(ele);
}
return this;
}
/**
*
* Supported configuration manager name and versions for an AWS OpsWorks Stacks operating system.
*
*
* @param configurationManagers
* Supported configuration manager name and versions for an AWS OpsWorks Stacks operating system.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OperatingSystem withConfigurationManagers(java.util.Collection configurationManagers) {
setConfigurationManagers(configurationManagers);
return this;
}
/**
*
* A short name for the operating system manufacturer.
*
*
* @param reportedName
* A short name for the operating system manufacturer.
*/
public void setReportedName(String reportedName) {
this.reportedName = reportedName;
}
/**
*
* A short name for the operating system manufacturer.
*
*
* @return A short name for the operating system manufacturer.
*/
public String getReportedName() {
return this.reportedName;
}
/**
*
* A short name for the operating system manufacturer.
*
*
* @param reportedName
* A short name for the operating system manufacturer.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OperatingSystem withReportedName(String reportedName) {
setReportedName(reportedName);
return this;
}
/**
*
* The version of the operating system, including the release and edition, if applicable.
*
*
* @param reportedVersion
* The version of the operating system, including the release and edition, if applicable.
*/
public void setReportedVersion(String reportedVersion) {
this.reportedVersion = reportedVersion;
}
/**
*
* The version of the operating system, including the release and edition, if applicable.
*
*
* @return The version of the operating system, including the release and edition, if applicable.
*/
public String getReportedVersion() {
return this.reportedVersion;
}
/**
*
* The version of the operating system, including the release and edition, if applicable.
*
*
* @param reportedVersion
* The version of the operating system, including the release and edition, if applicable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OperatingSystem withReportedVersion(String reportedVersion) {
setReportedVersion(reportedVersion);
return this;
}
/**
*
* Indicates that an operating system is not supported for new instances.
*
*
* @param supported
* Indicates that an operating system is not supported for new instances.
*/
public void setSupported(Boolean supported) {
this.supported = supported;
}
/**
*
* Indicates that an operating system is not supported for new instances.
*
*
* @return Indicates that an operating system is not supported for new instances.
*/
public Boolean getSupported() {
return this.supported;
}
/**
*
* Indicates that an operating system is not supported for new instances.
*
*
* @param supported
* Indicates that an operating system is not supported for new instances.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OperatingSystem withSupported(Boolean supported) {
setSupported(supported);
return this;
}
/**
*
* Indicates that an operating system is not supported for new instances.
*
*
* @return Indicates that an operating system is not supported for new instances.
*/
public Boolean isSupported() {
return this.supported;
}
/**
* Returns a string representation of this object; useful for testing and debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getId() != null)
sb.append("Id: ").append(getId()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getConfigurationManagers() != null)
sb.append("ConfigurationManagers: ").append(getConfigurationManagers()).append(",");
if (getReportedName() != null)
sb.append("ReportedName: ").append(getReportedName()).append(",");
if (getReportedVersion() != null)
sb.append("ReportedVersion: ").append(getReportedVersion()).append(",");
if (getSupported() != null)
sb.append("Supported: ").append(getSupported());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof OperatingSystem == false)
return false;
OperatingSystem other = (OperatingSystem) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getId() == null ^ this.getId() == null)
return false;
if (other.getId() != null && other.getId().equals(this.getId()) == false)
return false;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getConfigurationManagers() == null ^ this.getConfigurationManagers() == null)
return false;
if (other.getConfigurationManagers() != null && other.getConfigurationManagers().equals(this.getConfigurationManagers()) == false)
return false;
if (other.getReportedName() == null ^ this.getReportedName() == null)
return false;
if (other.getReportedName() != null && other.getReportedName().equals(this.getReportedName()) == false)
return false;
if (other.getReportedVersion() == null ^ this.getReportedVersion() == null)
return false;
if (other.getReportedVersion() != null && other.getReportedVersion().equals(this.getReportedVersion()) == false)
return false;
if (other.getSupported() == null ^ this.getSupported() == null)
return false;
if (other.getSupported() != null && other.getSupported().equals(this.getSupported()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getConfigurationManagers() == null) ? 0 : getConfigurationManagers().hashCode());
hashCode = prime * hashCode + ((getReportedName() == null) ? 0 : getReportedName().hashCode());
hashCode = prime * hashCode + ((getReportedVersion() == null) ? 0 : getReportedVersion().hashCode());
hashCode = prime * hashCode + ((getSupported() == null) ? 0 : getSupported().hashCode());
return hashCode;
}
@Override
public OperatingSystem clone() {
try {
return (OperatingSystem) 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.opsworks.model.transform.OperatingSystemMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}