com.amazonaws.services.iottwinmaker.model.EntityPropertyReference 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 uniquely identifies an entity property.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class EntityPropertyReference implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the component.
*
*/
private String componentName;
/**
*
* The ID of the entity.
*
*/
private String entityId;
/**
*
* A mapping of external IDs to property names. External IDs uniquely identify properties from external data stores.
*
*/
private java.util.Map externalIdProperty;
/**
*
* The name of the property.
*
*/
private String propertyName;
/**
*
* 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 EntityPropertyReference withComponentName(String componentName) {
setComponentName(componentName);
return this;
}
/**
*
* The ID of the entity.
*
*
* @param entityId
* The ID of the entity.
*/
public void setEntityId(String entityId) {
this.entityId = entityId;
}
/**
*
* The ID of the entity.
*
*
* @return The ID of the entity.
*/
public String getEntityId() {
return this.entityId;
}
/**
*
* The ID of the entity.
*
*
* @param entityId
* The ID of the entity.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EntityPropertyReference withEntityId(String entityId) {
setEntityId(entityId);
return this;
}
/**
*
* A mapping of external IDs to property names. External IDs uniquely identify properties from external data stores.
*
*
* @return A mapping of external IDs to property names. External IDs uniquely identify properties from external data
* stores.
*/
public java.util.Map getExternalIdProperty() {
return externalIdProperty;
}
/**
*
* A mapping of external IDs to property names. External IDs uniquely identify properties from external data stores.
*
*
* @param externalIdProperty
* A mapping of external IDs to property names. External IDs uniquely identify properties from external data
* stores.
*/
public void setExternalIdProperty(java.util.Map externalIdProperty) {
this.externalIdProperty = externalIdProperty;
}
/**
*
* A mapping of external IDs to property names. External IDs uniquely identify properties from external data stores.
*
*
* @param externalIdProperty
* A mapping of external IDs to property names. External IDs uniquely identify properties from external data
* stores.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EntityPropertyReference withExternalIdProperty(java.util.Map externalIdProperty) {
setExternalIdProperty(externalIdProperty);
return this;
}
/**
* Add a single ExternalIdProperty entry
*
* @see EntityPropertyReference#withExternalIdProperty
* @returns a reference to this object so that method calls can be chained together.
*/
public EntityPropertyReference addExternalIdPropertyEntry(String key, String value) {
if (null == this.externalIdProperty) {
this.externalIdProperty = new java.util.HashMap();
}
if (this.externalIdProperty.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.externalIdProperty.put(key, value);
return this;
}
/**
* Removes all the entries added into ExternalIdProperty.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EntityPropertyReference clearExternalIdPropertyEntries() {
this.externalIdProperty = null;
return this;
}
/**
*
* The name of the property.
*
*
* @param propertyName
* The name of the property.
*/
public void setPropertyName(String propertyName) {
this.propertyName = propertyName;
}
/**
*
* The name of the property.
*
*
* @return The name of the property.
*/
public String getPropertyName() {
return this.propertyName;
}
/**
*
* The name of the property.
*
*
* @param propertyName
* The name of the property.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EntityPropertyReference withPropertyName(String propertyName) {
setPropertyName(propertyName);
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 (getEntityId() != null)
sb.append("EntityId: ").append(getEntityId()).append(",");
if (getExternalIdProperty() != null)
sb.append("ExternalIdProperty: ").append(getExternalIdProperty()).append(",");
if (getPropertyName() != null)
sb.append("PropertyName: ").append(getPropertyName());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof EntityPropertyReference == false)
return false;
EntityPropertyReference other = (EntityPropertyReference) obj;
if (other.getComponentName() == null ^ this.getComponentName() == null)
return false;
if (other.getComponentName() != null && other.getComponentName().equals(this.getComponentName()) == false)
return false;
if (other.getEntityId() == null ^ this.getEntityId() == null)
return false;
if (other.getEntityId() != null && other.getEntityId().equals(this.getEntityId()) == false)
return false;
if (other.getExternalIdProperty() == null ^ this.getExternalIdProperty() == null)
return false;
if (other.getExternalIdProperty() != null && other.getExternalIdProperty().equals(this.getExternalIdProperty()) == false)
return false;
if (other.getPropertyName() == null ^ this.getPropertyName() == null)
return false;
if (other.getPropertyName() != null && other.getPropertyName().equals(this.getPropertyName()) == 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 + ((getEntityId() == null) ? 0 : getEntityId().hashCode());
hashCode = prime * hashCode + ((getExternalIdProperty() == null) ? 0 : getExternalIdProperty().hashCode());
hashCode = prime * hashCode + ((getPropertyName() == null) ? 0 : getPropertyName().hashCode());
return hashCode;
}
@Override
public EntityPropertyReference clone() {
try {
return (EntityPropertyReference) 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.EntityPropertyReferenceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}