com.amazonaws.services.iottwinmaker.model.ComponentResponse 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 returns information about a component type create or update request.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ComponentResponse implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the component.
*
*/
private String componentName;
/**
*
* The ID of the component type.
*
*/
private String componentTypeId;
/**
*
* The name of the property definition set in the request.
*
*/
private String definedIn;
/**
*
* The description of the component type.
*
*/
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 status of the component type.
*
*/
private Status status;
/**
*
* The name of the component.
*
*
* @param componentName
* The name of the component.
*/
public void setComponentName(String componentName) {
this.componentName = componentName;
}
/**
*
* The name of the component.
*
*
* @return The name of the component.
*/
public String getComponentName() {
return this.componentName;
}
/**
*
* The name of the component.
*
*
* @param componentName
* The name of the component.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ComponentResponse withComponentName(String componentName) {
setComponentName(componentName);
return this;
}
/**
*
* 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 ComponentResponse withComponentTypeId(String componentTypeId) {
setComponentTypeId(componentTypeId);
return this;
}
/**
*
* The name of the property definition set in the request.
*
*
* @param definedIn
* The name of the property definition set in the request.
*/
public void setDefinedIn(String definedIn) {
this.definedIn = definedIn;
}
/**
*
* The name of the property definition set in the request.
*
*
* @return The name of the property definition set in the request.
*/
public String getDefinedIn() {
return this.definedIn;
}
/**
*
* The name of the property definition set in the request.
*
*
* @param definedIn
* The name of the property definition set in the request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ComponentResponse withDefinedIn(String definedIn) {
setDefinedIn(definedIn);
return this;
}
/**
*
* 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 ComponentResponse 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 ComponentResponse withProperties(java.util.Map properties) {
setProperties(properties);
return this;
}
/**
* Add a single Properties entry
*
* @see ComponentResponse#withProperties
* @returns a reference to this object so that method calls can be chained together.
*/
public ComponentResponse addPropertiesEntry(String key, PropertyResponse 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 ComponentResponse clearPropertiesEntries() {
this.properties = null;
return this;
}
/**
*
* The status of the component type.
*
*
* @param status
* The status of the component type.
*/
public void setStatus(Status status) {
this.status = status;
}
/**
*
* The status of the component type.
*
*
* @return The status of the component type.
*/
public Status getStatus() {
return this.status;
}
/**
*
* The status of the component type.
*
*
* @param status
* The status of the component type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ComponentResponse withStatus(Status status) {
setStatus(status);
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 (getComponentName() != null)
sb.append("ComponentName: ").append(getComponentName()).append(",");
if (getComponentTypeId() != null)
sb.append("ComponentTypeId: ").append(getComponentTypeId()).append(",");
if (getDefinedIn() != null)
sb.append("DefinedIn: ").append(getDefinedIn()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getProperties() != null)
sb.append("Properties: ").append(getProperties()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ComponentResponse == false)
return false;
ComponentResponse other = (ComponentResponse) obj;
if (other.getComponentName() == null ^ this.getComponentName() == null)
return false;
if (other.getComponentName() != null && other.getComponentName().equals(this.getComponentName()) == false)
return false;
if (other.getComponentTypeId() == null ^ this.getComponentTypeId() == null)
return false;
if (other.getComponentTypeId() != null && other.getComponentTypeId().equals(this.getComponentTypeId()) == false)
return false;
if (other.getDefinedIn() == null ^ this.getDefinedIn() == null)
return false;
if (other.getDefinedIn() != null && other.getDefinedIn().equals(this.getDefinedIn()) == 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;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getComponentName() == null) ? 0 : getComponentName().hashCode());
hashCode = prime * hashCode + ((getComponentTypeId() == null) ? 0 : getComponentTypeId().hashCode());
hashCode = prime * hashCode + ((getDefinedIn() == null) ? 0 : getDefinedIn().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getProperties() == null) ? 0 : getProperties().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
return hashCode;
}
@Override
public ComponentResponse clone() {
try {
return (ComponentResponse) 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.ComponentResponseMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}