
com.amazonaws.services.iot.model.OTAUpdateFile Maven / Gradle / Ivy
/*
* 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.iot.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes a file to be associated with an OTA update.
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class OTAUpdateFile implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the file.
*
*/
private String fileName;
/**
*
* The file version.
*
*/
private String fileVersion;
/**
*
* The location of the updated firmware.
*
*/
private FileLocation fileLocation;
/**
*
* The code signing method of the file.
*
*/
private CodeSigning codeSigning;
/**
*
* A list of name/attribute pairs.
*
*/
private java.util.Map attributes;
/**
*
* The name of the file.
*
*
* @param fileName
* The name of the file.
*/
public void setFileName(String fileName) {
this.fileName = fileName;
}
/**
*
* The name of the file.
*
*
* @return The name of the file.
*/
public String getFileName() {
return this.fileName;
}
/**
*
* The name of the file.
*
*
* @param fileName
* The name of the file.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OTAUpdateFile withFileName(String fileName) {
setFileName(fileName);
return this;
}
/**
*
* The file version.
*
*
* @param fileVersion
* The file version.
*/
public void setFileVersion(String fileVersion) {
this.fileVersion = fileVersion;
}
/**
*
* The file version.
*
*
* @return The file version.
*/
public String getFileVersion() {
return this.fileVersion;
}
/**
*
* The file version.
*
*
* @param fileVersion
* The file version.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OTAUpdateFile withFileVersion(String fileVersion) {
setFileVersion(fileVersion);
return this;
}
/**
*
* The location of the updated firmware.
*
*
* @param fileLocation
* The location of the updated firmware.
*/
public void setFileLocation(FileLocation fileLocation) {
this.fileLocation = fileLocation;
}
/**
*
* The location of the updated firmware.
*
*
* @return The location of the updated firmware.
*/
public FileLocation getFileLocation() {
return this.fileLocation;
}
/**
*
* The location of the updated firmware.
*
*
* @param fileLocation
* The location of the updated firmware.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OTAUpdateFile withFileLocation(FileLocation fileLocation) {
setFileLocation(fileLocation);
return this;
}
/**
*
* The code signing method of the file.
*
*
* @param codeSigning
* The code signing method of the file.
*/
public void setCodeSigning(CodeSigning codeSigning) {
this.codeSigning = codeSigning;
}
/**
*
* The code signing method of the file.
*
*
* @return The code signing method of the file.
*/
public CodeSigning getCodeSigning() {
return this.codeSigning;
}
/**
*
* The code signing method of the file.
*
*
* @param codeSigning
* The code signing method of the file.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OTAUpdateFile withCodeSigning(CodeSigning codeSigning) {
setCodeSigning(codeSigning);
return this;
}
/**
*
* A list of name/attribute pairs.
*
*
* @return A list of name/attribute pairs.
*/
public java.util.Map getAttributes() {
return attributes;
}
/**
*
* A list of name/attribute pairs.
*
*
* @param attributes
* A list of name/attribute pairs.
*/
public void setAttributes(java.util.Map attributes) {
this.attributes = attributes;
}
/**
*
* A list of name/attribute pairs.
*
*
* @param attributes
* A list of name/attribute pairs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OTAUpdateFile withAttributes(java.util.Map attributes) {
setAttributes(attributes);
return this;
}
/**
* Add a single Attributes entry
*
* @see OTAUpdateFile#withAttributes
* @returns a reference to this object so that method calls can be chained together.
*/
public OTAUpdateFile addAttributesEntry(String key, String value) {
if (null == this.attributes) {
this.attributes = new java.util.HashMap();
}
if (this.attributes.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.attributes.put(key, value);
return this;
}
/**
* Removes all the entries added into Attributes.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OTAUpdateFile clearAttributesEntries() {
this.attributes = null;
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 (getFileName() != null)
sb.append("FileName: ").append(getFileName()).append(",");
if (getFileVersion() != null)
sb.append("FileVersion: ").append(getFileVersion()).append(",");
if (getFileLocation() != null)
sb.append("FileLocation: ").append(getFileLocation()).append(",");
if (getCodeSigning() != null)
sb.append("CodeSigning: ").append(getCodeSigning()).append(",");
if (getAttributes() != null)
sb.append("Attributes: ").append(getAttributes());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof OTAUpdateFile == false)
return false;
OTAUpdateFile other = (OTAUpdateFile) obj;
if (other.getFileName() == null ^ this.getFileName() == null)
return false;
if (other.getFileName() != null && other.getFileName().equals(this.getFileName()) == false)
return false;
if (other.getFileVersion() == null ^ this.getFileVersion() == null)
return false;
if (other.getFileVersion() != null && other.getFileVersion().equals(this.getFileVersion()) == false)
return false;
if (other.getFileLocation() == null ^ this.getFileLocation() == null)
return false;
if (other.getFileLocation() != null && other.getFileLocation().equals(this.getFileLocation()) == false)
return false;
if (other.getCodeSigning() == null ^ this.getCodeSigning() == null)
return false;
if (other.getCodeSigning() != null && other.getCodeSigning().equals(this.getCodeSigning()) == false)
return false;
if (other.getAttributes() == null ^ this.getAttributes() == null)
return false;
if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getFileName() == null) ? 0 : getFileName().hashCode());
hashCode = prime * hashCode + ((getFileVersion() == null) ? 0 : getFileVersion().hashCode());
hashCode = prime * hashCode + ((getFileLocation() == null) ? 0 : getFileLocation().hashCode());
hashCode = prime * hashCode + ((getCodeSigning() == null) ? 0 : getCodeSigning().hashCode());
hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode());
return hashCode;
}
@Override
public OTAUpdateFile clone() {
try {
return (OTAUpdateFile) 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.iot.model.transform.OTAUpdateFileMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}