com.amazonaws.services.iottwinmaker.model.PropertyDefinitionRequest 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 a property.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PropertyDefinitionRequest implements Serializable, Cloneable, StructuredPojo {
/**
*
* An object that contains information about the data type.
*
*/
private DataType dataType;
/**
*
* A Boolean value that specifies whether the property is required.
*
*/
private Boolean isRequiredInEntity;
/**
*
* A Boolean value that specifies whether the property ID comes from an external data store.
*
*/
private Boolean isExternalId;
/**
*
* A Boolean value that specifies whether the property is stored externally.
*
*/
private Boolean isStoredExternally;
/**
*
* A Boolean value that specifies whether the property consists of time series data.
*
*/
private Boolean isTimeSeries;
/**
*
* An object that contains the default value.
*
*/
private DataValue defaultValue;
/**
*
* A mapping that specifies configuration information about the property. Use this field to specify information that
* you read from and write to an external source.
*
*/
private java.util.Map configuration;
/**
*
* A friendly name for the property.
*
*/
private String displayName;
/**
*
* An object that contains information about the data type.
*
*
* @param dataType
* An object that contains information about the data type.
*/
public void setDataType(DataType dataType) {
this.dataType = dataType;
}
/**
*
* An object that contains information about the data type.
*
*
* @return An object that contains information about the data type.
*/
public DataType getDataType() {
return this.dataType;
}
/**
*
* An object that contains information about the data type.
*
*
* @param dataType
* An object that contains information about the data type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PropertyDefinitionRequest withDataType(DataType dataType) {
setDataType(dataType);
return this;
}
/**
*
* A Boolean value that specifies whether the property is required.
*
*
* @param isRequiredInEntity
* A Boolean value that specifies whether the property is required.
*/
public void setIsRequiredInEntity(Boolean isRequiredInEntity) {
this.isRequiredInEntity = isRequiredInEntity;
}
/**
*
* A Boolean value that specifies whether the property is required.
*
*
* @return A Boolean value that specifies whether the property is required.
*/
public Boolean getIsRequiredInEntity() {
return this.isRequiredInEntity;
}
/**
*
* A Boolean value that specifies whether the property is required.
*
*
* @param isRequiredInEntity
* A Boolean value that specifies whether the property is required.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PropertyDefinitionRequest withIsRequiredInEntity(Boolean isRequiredInEntity) {
setIsRequiredInEntity(isRequiredInEntity);
return this;
}
/**
*
* A Boolean value that specifies whether the property is required.
*
*
* @return A Boolean value that specifies whether the property is required.
*/
public Boolean isRequiredInEntity() {
return this.isRequiredInEntity;
}
/**
*
* A Boolean value that specifies whether the property ID comes from an external data store.
*
*
* @param isExternalId
* A Boolean value that specifies whether the property ID comes from an external data store.
*/
public void setIsExternalId(Boolean isExternalId) {
this.isExternalId = isExternalId;
}
/**
*
* A Boolean value that specifies whether the property ID comes from an external data store.
*
*
* @return A Boolean value that specifies whether the property ID comes from an external data store.
*/
public Boolean getIsExternalId() {
return this.isExternalId;
}
/**
*
* A Boolean value that specifies whether the property ID comes from an external data store.
*
*
* @param isExternalId
* A Boolean value that specifies whether the property ID comes from an external data store.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PropertyDefinitionRequest withIsExternalId(Boolean isExternalId) {
setIsExternalId(isExternalId);
return this;
}
/**
*
* A Boolean value that specifies whether the property ID comes from an external data store.
*
*
* @return A Boolean value that specifies whether the property ID comes from an external data store.
*/
public Boolean isExternalId() {
return this.isExternalId;
}
/**
*
* A Boolean value that specifies whether the property is stored externally.
*
*
* @param isStoredExternally
* A Boolean value that specifies whether the property is stored externally.
*/
public void setIsStoredExternally(Boolean isStoredExternally) {
this.isStoredExternally = isStoredExternally;
}
/**
*
* A Boolean value that specifies whether the property is stored externally.
*
*
* @return A Boolean value that specifies whether the property is stored externally.
*/
public Boolean getIsStoredExternally() {
return this.isStoredExternally;
}
/**
*
* A Boolean value that specifies whether the property is stored externally.
*
*
* @param isStoredExternally
* A Boolean value that specifies whether the property is stored externally.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PropertyDefinitionRequest withIsStoredExternally(Boolean isStoredExternally) {
setIsStoredExternally(isStoredExternally);
return this;
}
/**
*
* A Boolean value that specifies whether the property is stored externally.
*
*
* @return A Boolean value that specifies whether the property is stored externally.
*/
public Boolean isStoredExternally() {
return this.isStoredExternally;
}
/**
*
* A Boolean value that specifies whether the property consists of time series data.
*
*
* @param isTimeSeries
* A Boolean value that specifies whether the property consists of time series data.
*/
public void setIsTimeSeries(Boolean isTimeSeries) {
this.isTimeSeries = isTimeSeries;
}
/**
*
* A Boolean value that specifies whether the property consists of time series data.
*
*
* @return A Boolean value that specifies whether the property consists of time series data.
*/
public Boolean getIsTimeSeries() {
return this.isTimeSeries;
}
/**
*
* A Boolean value that specifies whether the property consists of time series data.
*
*
* @param isTimeSeries
* A Boolean value that specifies whether the property consists of time series data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PropertyDefinitionRequest withIsTimeSeries(Boolean isTimeSeries) {
setIsTimeSeries(isTimeSeries);
return this;
}
/**
*
* A Boolean value that specifies whether the property consists of time series data.
*
*
* @return A Boolean value that specifies whether the property consists of time series data.
*/
public Boolean isTimeSeries() {
return this.isTimeSeries;
}
/**
*
* An object that contains the default value.
*
*
* @param defaultValue
* An object that contains the default value.
*/
public void setDefaultValue(DataValue defaultValue) {
this.defaultValue = defaultValue;
}
/**
*
* An object that contains the default value.
*
*
* @return An object that contains the default value.
*/
public DataValue getDefaultValue() {
return this.defaultValue;
}
/**
*
* An object that contains the default value.
*
*
* @param defaultValue
* An object that contains the default value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PropertyDefinitionRequest withDefaultValue(DataValue defaultValue) {
setDefaultValue(defaultValue);
return this;
}
/**
*
* A mapping that specifies configuration information about the property. Use this field to specify information that
* you read from and write to an external source.
*
*
* @return A mapping that specifies configuration information about the property. Use this field to specify
* information that you read from and write to an external source.
*/
public java.util.Map getConfiguration() {
return configuration;
}
/**
*
* A mapping that specifies configuration information about the property. Use this field to specify information that
* you read from and write to an external source.
*
*
* @param configuration
* A mapping that specifies configuration information about the property. Use this field to specify
* information that you read from and write to an external source.
*/
public void setConfiguration(java.util.Map configuration) {
this.configuration = configuration;
}
/**
*
* A mapping that specifies configuration information about the property. Use this field to specify information that
* you read from and write to an external source.
*
*
* @param configuration
* A mapping that specifies configuration information about the property. Use this field to specify
* information that you read from and write to an external source.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PropertyDefinitionRequest withConfiguration(java.util.Map configuration) {
setConfiguration(configuration);
return this;
}
/**
* Add a single Configuration entry
*
* @see PropertyDefinitionRequest#withConfiguration
* @returns a reference to this object so that method calls can be chained together.
*/
public PropertyDefinitionRequest addConfigurationEntry(String key, String value) {
if (null == this.configuration) {
this.configuration = new java.util.HashMap();
}
if (this.configuration.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.configuration.put(key, value);
return this;
}
/**
* Removes all the entries added into Configuration.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PropertyDefinitionRequest clearConfigurationEntries() {
this.configuration = null;
return this;
}
/**
*
* A friendly name for the property.
*
*
* @param displayName
* A friendly name for the property.
*/
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
/**
*
* A friendly name for the property.
*
*
* @return A friendly name for the property.
*/
public String getDisplayName() {
return this.displayName;
}
/**
*
* A friendly name for the property.
*
*
* @param displayName
* A friendly name for the property.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PropertyDefinitionRequest withDisplayName(String displayName) {
setDisplayName(displayName);
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 (getDataType() != null)
sb.append("DataType: ").append(getDataType()).append(",");
if (getIsRequiredInEntity() != null)
sb.append("IsRequiredInEntity: ").append(getIsRequiredInEntity()).append(",");
if (getIsExternalId() != null)
sb.append("IsExternalId: ").append(getIsExternalId()).append(",");
if (getIsStoredExternally() != null)
sb.append("IsStoredExternally: ").append(getIsStoredExternally()).append(",");
if (getIsTimeSeries() != null)
sb.append("IsTimeSeries: ").append(getIsTimeSeries()).append(",");
if (getDefaultValue() != null)
sb.append("DefaultValue: ").append(getDefaultValue()).append(",");
if (getConfiguration() != null)
sb.append("Configuration: ").append(getConfiguration()).append(",");
if (getDisplayName() != null)
sb.append("DisplayName: ").append(getDisplayName());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PropertyDefinitionRequest == false)
return false;
PropertyDefinitionRequest other = (PropertyDefinitionRequest) obj;
if (other.getDataType() == null ^ this.getDataType() == null)
return false;
if (other.getDataType() != null && other.getDataType().equals(this.getDataType()) == false)
return false;
if (other.getIsRequiredInEntity() == null ^ this.getIsRequiredInEntity() == null)
return false;
if (other.getIsRequiredInEntity() != null && other.getIsRequiredInEntity().equals(this.getIsRequiredInEntity()) == false)
return false;
if (other.getIsExternalId() == null ^ this.getIsExternalId() == null)
return false;
if (other.getIsExternalId() != null && other.getIsExternalId().equals(this.getIsExternalId()) == false)
return false;
if (other.getIsStoredExternally() == null ^ this.getIsStoredExternally() == null)
return false;
if (other.getIsStoredExternally() != null && other.getIsStoredExternally().equals(this.getIsStoredExternally()) == false)
return false;
if (other.getIsTimeSeries() == null ^ this.getIsTimeSeries() == null)
return false;
if (other.getIsTimeSeries() != null && other.getIsTimeSeries().equals(this.getIsTimeSeries()) == false)
return false;
if (other.getDefaultValue() == null ^ this.getDefaultValue() == null)
return false;
if (other.getDefaultValue() != null && other.getDefaultValue().equals(this.getDefaultValue()) == false)
return false;
if (other.getConfiguration() == null ^ this.getConfiguration() == null)
return false;
if (other.getConfiguration() != null && other.getConfiguration().equals(this.getConfiguration()) == false)
return false;
if (other.getDisplayName() == null ^ this.getDisplayName() == null)
return false;
if (other.getDisplayName() != null && other.getDisplayName().equals(this.getDisplayName()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDataType() == null) ? 0 : getDataType().hashCode());
hashCode = prime * hashCode + ((getIsRequiredInEntity() == null) ? 0 : getIsRequiredInEntity().hashCode());
hashCode = prime * hashCode + ((getIsExternalId() == null) ? 0 : getIsExternalId().hashCode());
hashCode = prime * hashCode + ((getIsStoredExternally() == null) ? 0 : getIsStoredExternally().hashCode());
hashCode = prime * hashCode + ((getIsTimeSeries() == null) ? 0 : getIsTimeSeries().hashCode());
hashCode = prime * hashCode + ((getDefaultValue() == null) ? 0 : getDefaultValue().hashCode());
hashCode = prime * hashCode + ((getConfiguration() == null) ? 0 : getConfiguration().hashCode());
hashCode = prime * hashCode + ((getDisplayName() == null) ? 0 : getDisplayName().hashCode());
return hashCode;
}
@Override
public PropertyDefinitionRequest clone() {
try {
return (PropertyDefinitionRequest) 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.PropertyDefinitionRequestMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}