com.amazonaws.services.iottwinmaker.model.ComponentRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-iottwinmaker Show documentation
/*
* Copyright 2017-2022 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.iottwinmaker.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* An object that sets information about a component type create or update request.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ComponentRequest implements Serializable, Cloneable, StructuredPojo {
/**
*
* The ID of the component type.
*
*/
private String componentTypeId;
/**
*
* The description of the component request.
*
*/
private String description;
/**
*
* An object that maps strings to the properties to set in the component type. Each string in the mapping must be
* unique to this object.
*
*/
private java.util.Map properties;
/**
*
* The ID of the component type.
*
*
* @param componentTypeId
* The ID of the component type.
*/
public void setComponentTypeId(String componentTypeId) {
this.componentTypeId = componentTypeId;
}
/**
*
* The ID of the component type.
*
*
* @return The ID of the component type.
*/
public String getComponentTypeId() {
return this.componentTypeId;
}
/**
*
* The ID of the component type.
*
*
* @param componentTypeId
* The ID of the component type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ComponentRequest withComponentTypeId(String componentTypeId) {
setComponentTypeId(componentTypeId);
return this;
}
/**
*
* The description of the component request.
*
*
* @param description
* The description of the component request.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* The description of the component request.
*
*
* @return The description of the component request.
*/
public String getDescription() {
return this.description;
}
/**
*
* The description of the component request.
*
*
* @param description
* The description of the component request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ComponentRequest withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* An object that maps strings to the properties to set in the component type. Each string in the mapping must be
* unique to this object.
*
*
* @return An object that maps strings to the properties to set in the component type. Each string in the mapping
* must be unique to this object.
*/
public java.util.Map getProperties() {
return properties;
}
/**
*
* An object that maps strings to the properties to set in the component type. Each string in the mapping must be
* unique to this object.
*
*
* @param properties
* An object that maps strings to the properties to set in the component type. Each string in the mapping
* must be unique to this object.
*/
public void setProperties(java.util.Map properties) {
this.properties = properties;
}
/**
*
* An object that maps strings to the properties to set in the component type. Each string in the mapping must be
* unique to this object.
*
*
* @param properties
* An object that maps strings to the properties to set in the component type. Each string in the mapping
* must be unique to this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ComponentRequest withProperties(java.util.Map properties) {
setProperties(properties);
return this;
}
/**
* Add a single Properties entry
*
* @see ComponentRequest#withProperties
* @returns a reference to this object so that method calls can be chained together.
*/
public ComponentRequest addPropertiesEntry(String key, PropertyRequest value) {
if (null == this.properties) {
this.properties = new java.util.HashMap();
}
if (this.properties.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.properties.put(key, value);
return this;
}
/**
* Removes all the entries added into Properties.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ComponentRequest clearPropertiesEntries() {
this.properties = 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 (getComponentTypeId() != null)
sb.append("ComponentTypeId: ").append(getComponentTypeId()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getProperties() != null)
sb.append("Properties: ").append(getProperties());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ComponentRequest == false)
return false;
ComponentRequest other = (ComponentRequest) obj;
if (other.getComponentTypeId() == null ^ this.getComponentTypeId() == null)
return false;
if (other.getComponentTypeId() != null && other.getComponentTypeId().equals(this.getComponentTypeId()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getProperties() == null ^ this.getProperties() == null)
return false;
if (other.getProperties() != null && other.getProperties().equals(this.getProperties()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getComponentTypeId() == null) ? 0 : getComponentTypeId().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getProperties() == null) ? 0 : getProperties().hashCode());
return hashCode;
}
@Override
public ComponentRequest clone() {
try {
return (ComponentRequest) 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.iottwinmaker.model.transform.ComponentRequestMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}