com.amazonaws.services.iottwinmaker.model.CompositeComponentRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-iottwinmaker 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.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 the composite component update request.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CompositeComponentRequest implements Serializable, Cloneable, StructuredPojo {
/**
*
* The description of the component type.
*
*/
private String description;
/**
*
* This is 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 property groups.
*
*/
private java.util.Map propertyGroups;
/**
*
* The description of the component type.
*
*
* @param description
* The description of the component type.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* The description of the component type.
*
*
* @return The description of the component type.
*/
public String getDescription() {
return this.description;
}
/**
*
* The description of the component type.
*
*
* @param description
* The description of the component type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CompositeComponentRequest withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* This is 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 This is 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;
}
/**
*
* This is 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
* This is 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;
}
/**
*
* This is 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
* This is 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 CompositeComponentRequest withProperties(java.util.Map properties) {
setProperties(properties);
return this;
}
/**
* Add a single Properties entry
*
* @see CompositeComponentRequest#withProperties
* @returns a reference to this object so that method calls can be chained together.
*/
public CompositeComponentRequest 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 CompositeComponentRequest clearPropertiesEntries() {
this.properties = null;
return this;
}
/**
*
* The property groups.
*
*
* @return The property groups.
*/
public java.util.Map getPropertyGroups() {
return propertyGroups;
}
/**
*
* The property groups.
*
*
* @param propertyGroups
* The property groups.
*/
public void setPropertyGroups(java.util.Map propertyGroups) {
this.propertyGroups = propertyGroups;
}
/**
*
* The property groups.
*
*
* @param propertyGroups
* The property groups.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CompositeComponentRequest withPropertyGroups(java.util.Map propertyGroups) {
setPropertyGroups(propertyGroups);
return this;
}
/**
* Add a single PropertyGroups entry
*
* @see CompositeComponentRequest#withPropertyGroups
* @returns a reference to this object so that method calls can be chained together.
*/
public CompositeComponentRequest addPropertyGroupsEntry(String key, ComponentPropertyGroupRequest value) {
if (null == this.propertyGroups) {
this.propertyGroups = new java.util.HashMap();
}
if (this.propertyGroups.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.propertyGroups.put(key, value);
return this;
}
/**
* Removes all the entries added into PropertyGroups.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CompositeComponentRequest clearPropertyGroupsEntries() {
this.propertyGroups = 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 (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getProperties() != null)
sb.append("Properties: ").append(getProperties()).append(",");
if (getPropertyGroups() != null)
sb.append("PropertyGroups: ").append(getPropertyGroups());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CompositeComponentRequest == false)
return false;
CompositeComponentRequest other = (CompositeComponentRequest) obj;
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;
if (other.getPropertyGroups() == null ^ this.getPropertyGroups() == null)
return false;
if (other.getPropertyGroups() != null && other.getPropertyGroups().equals(this.getPropertyGroups()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getProperties() == null) ? 0 : getProperties().hashCode());
hashCode = prime * hashCode + ((getPropertyGroups() == null) ? 0 : getPropertyGroups().hashCode());
return hashCode;
}
@Override
public CompositeComponentRequest clone() {
try {
return (CompositeComponentRequest) 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.CompositeComponentRequestMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}