
com.amazonaws.services.iot.model.ThingIndexingConfiguration Maven / Gradle / Ivy
/*
* Copyright 2015-2020 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.iot.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The thing indexing configuration. For more information, see Managing Thing Indexing.
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ThingIndexingConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* Thing indexing mode. Valid values are:
*
*
* -
*
* REGISTRY – Your thing index contains registry data only.
*
*
* -
*
* REGISTRY_AND_SHADOW - Your thing index contains registry and shadow data.
*
*
* -
*
* OFF - Thing indexing is disabled.
*
*
*
*/
private String thingIndexingMode;
/**
*
* Thing connectivity indexing mode. Valid values are:
*
*
* -
*
* STATUS – Your thing index contains connectivity status. To enable thing connectivity indexing, thingIndexMode
* must not be set to OFF.
*
*
* -
*
* OFF - Thing connectivity status indexing is disabled.
*
*
*
*/
private String thingConnectivityIndexingMode;
/**
*
* Contains fields that are indexed and whose types are already known by the Fleet Indexing service.
*
*/
private java.util.List managedFields;
/**
*
* Contains custom field names and their data type.
*
*/
private java.util.List customFields;
/**
*
* Thing indexing mode. Valid values are:
*
*
* -
*
* REGISTRY – Your thing index contains registry data only.
*
*
* -
*
* REGISTRY_AND_SHADOW - Your thing index contains registry and shadow data.
*
*
* -
*
* OFF - Thing indexing is disabled.
*
*
*
*
* @param thingIndexingMode
* Thing indexing mode. Valid values are:
*
* -
*
* REGISTRY – Your thing index contains registry data only.
*
*
* -
*
* REGISTRY_AND_SHADOW - Your thing index contains registry and shadow data.
*
*
* -
*
* OFF - Thing indexing is disabled.
*
*
* @see ThingIndexingMode
*/
public void setThingIndexingMode(String thingIndexingMode) {
this.thingIndexingMode = thingIndexingMode;
}
/**
*
* Thing indexing mode. Valid values are:
*
*
* -
*
* REGISTRY – Your thing index contains registry data only.
*
*
* -
*
* REGISTRY_AND_SHADOW - Your thing index contains registry and shadow data.
*
*
* -
*
* OFF - Thing indexing is disabled.
*
*
*
*
* @return Thing indexing mode. Valid values are:
*
* -
*
* REGISTRY – Your thing index contains registry data only.
*
*
* -
*
* REGISTRY_AND_SHADOW - Your thing index contains registry and shadow data.
*
*
* -
*
* OFF - Thing indexing is disabled.
*
*
* @see ThingIndexingMode
*/
public String getThingIndexingMode() {
return this.thingIndexingMode;
}
/**
*
* Thing indexing mode. Valid values are:
*
*
* -
*
* REGISTRY – Your thing index contains registry data only.
*
*
* -
*
* REGISTRY_AND_SHADOW - Your thing index contains registry and shadow data.
*
*
* -
*
* OFF - Thing indexing is disabled.
*
*
*
*
* @param thingIndexingMode
* Thing indexing mode. Valid values are:
*
* -
*
* REGISTRY – Your thing index contains registry data only.
*
*
* -
*
* REGISTRY_AND_SHADOW - Your thing index contains registry and shadow data.
*
*
* -
*
* OFF - Thing indexing is disabled.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ThingIndexingMode
*/
public ThingIndexingConfiguration withThingIndexingMode(String thingIndexingMode) {
setThingIndexingMode(thingIndexingMode);
return this;
}
/**
*
* Thing indexing mode. Valid values are:
*
*
* -
*
* REGISTRY – Your thing index contains registry data only.
*
*
* -
*
* REGISTRY_AND_SHADOW - Your thing index contains registry and shadow data.
*
*
* -
*
* OFF - Thing indexing is disabled.
*
*
*
*
* @param thingIndexingMode
* Thing indexing mode. Valid values are:
*
* -
*
* REGISTRY – Your thing index contains registry data only.
*
*
* -
*
* REGISTRY_AND_SHADOW - Your thing index contains registry and shadow data.
*
*
* -
*
* OFF - Thing indexing is disabled.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ThingIndexingMode
*/
public ThingIndexingConfiguration withThingIndexingMode(ThingIndexingMode thingIndexingMode) {
this.thingIndexingMode = thingIndexingMode.toString();
return this;
}
/**
*
* Thing connectivity indexing mode. Valid values are:
*
*
* -
*
* STATUS – Your thing index contains connectivity status. To enable thing connectivity indexing, thingIndexMode
* must not be set to OFF.
*
*
* -
*
* OFF - Thing connectivity status indexing is disabled.
*
*
*
*
* @param thingConnectivityIndexingMode
* Thing connectivity indexing mode. Valid values are:
*
* -
*
* STATUS – Your thing index contains connectivity status. To enable thing connectivity indexing,
* thingIndexMode must not be set to OFF.
*
*
* -
*
* OFF - Thing connectivity status indexing is disabled.
*
*
* @see ThingConnectivityIndexingMode
*/
public void setThingConnectivityIndexingMode(String thingConnectivityIndexingMode) {
this.thingConnectivityIndexingMode = thingConnectivityIndexingMode;
}
/**
*
* Thing connectivity indexing mode. Valid values are:
*
*
* -
*
* STATUS – Your thing index contains connectivity status. To enable thing connectivity indexing, thingIndexMode
* must not be set to OFF.
*
*
* -
*
* OFF - Thing connectivity status indexing is disabled.
*
*
*
*
* @return Thing connectivity indexing mode. Valid values are:
*
* -
*
* STATUS – Your thing index contains connectivity status. To enable thing connectivity indexing,
* thingIndexMode must not be set to OFF.
*
*
* -
*
* OFF - Thing connectivity status indexing is disabled.
*
*
* @see ThingConnectivityIndexingMode
*/
public String getThingConnectivityIndexingMode() {
return this.thingConnectivityIndexingMode;
}
/**
*
* Thing connectivity indexing mode. Valid values are:
*
*
* -
*
* STATUS – Your thing index contains connectivity status. To enable thing connectivity indexing, thingIndexMode
* must not be set to OFF.
*
*
* -
*
* OFF - Thing connectivity status indexing is disabled.
*
*
*
*
* @param thingConnectivityIndexingMode
* Thing connectivity indexing mode. Valid values are:
*
* -
*
* STATUS – Your thing index contains connectivity status. To enable thing connectivity indexing,
* thingIndexMode must not be set to OFF.
*
*
* -
*
* OFF - Thing connectivity status indexing is disabled.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ThingConnectivityIndexingMode
*/
public ThingIndexingConfiguration withThingConnectivityIndexingMode(String thingConnectivityIndexingMode) {
setThingConnectivityIndexingMode(thingConnectivityIndexingMode);
return this;
}
/**
*
* Thing connectivity indexing mode. Valid values are:
*
*
* -
*
* STATUS – Your thing index contains connectivity status. To enable thing connectivity indexing, thingIndexMode
* must not be set to OFF.
*
*
* -
*
* OFF - Thing connectivity status indexing is disabled.
*
*
*
*
* @param thingConnectivityIndexingMode
* Thing connectivity indexing mode. Valid values are:
*
* -
*
* STATUS – Your thing index contains connectivity status. To enable thing connectivity indexing,
* thingIndexMode must not be set to OFF.
*
*
* -
*
* OFF - Thing connectivity status indexing is disabled.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ThingConnectivityIndexingMode
*/
public ThingIndexingConfiguration withThingConnectivityIndexingMode(ThingConnectivityIndexingMode thingConnectivityIndexingMode) {
this.thingConnectivityIndexingMode = thingConnectivityIndexingMode.toString();
return this;
}
/**
*
* Contains fields that are indexed and whose types are already known by the Fleet Indexing service.
*
*
* @return Contains fields that are indexed and whose types are already known by the Fleet Indexing service.
*/
public java.util.List getManagedFields() {
return managedFields;
}
/**
*
* Contains fields that are indexed and whose types are already known by the Fleet Indexing service.
*
*
* @param managedFields
* Contains fields that are indexed and whose types are already known by the Fleet Indexing service.
*/
public void setManagedFields(java.util.Collection managedFields) {
if (managedFields == null) {
this.managedFields = null;
return;
}
this.managedFields = new java.util.ArrayList(managedFields);
}
/**
*
* Contains fields that are indexed and whose types are already known by the Fleet Indexing service.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setManagedFields(java.util.Collection)} or {@link #withManagedFields(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param managedFields
* Contains fields that are indexed and whose types are already known by the Fleet Indexing service.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ThingIndexingConfiguration withManagedFields(Field... managedFields) {
if (this.managedFields == null) {
setManagedFields(new java.util.ArrayList(managedFields.length));
}
for (Field ele : managedFields) {
this.managedFields.add(ele);
}
return this;
}
/**
*
* Contains fields that are indexed and whose types are already known by the Fleet Indexing service.
*
*
* @param managedFields
* Contains fields that are indexed and whose types are already known by the Fleet Indexing service.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ThingIndexingConfiguration withManagedFields(java.util.Collection managedFields) {
setManagedFields(managedFields);
return this;
}
/**
*
* Contains custom field names and their data type.
*
*
* @return Contains custom field names and their data type.
*/
public java.util.List getCustomFields() {
return customFields;
}
/**
*
* Contains custom field names and their data type.
*
*
* @param customFields
* Contains custom field names and their data type.
*/
public void setCustomFields(java.util.Collection customFields) {
if (customFields == null) {
this.customFields = null;
return;
}
this.customFields = new java.util.ArrayList(customFields);
}
/**
*
* Contains custom field names and their data type.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setCustomFields(java.util.Collection)} or {@link #withCustomFields(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param customFields
* Contains custom field names and their data type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ThingIndexingConfiguration withCustomFields(Field... customFields) {
if (this.customFields == null) {
setCustomFields(new java.util.ArrayList(customFields.length));
}
for (Field ele : customFields) {
this.customFields.add(ele);
}
return this;
}
/**
*
* Contains custom field names and their data type.
*
*
* @param customFields
* Contains custom field names and their data type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ThingIndexingConfiguration withCustomFields(java.util.Collection customFields) {
setCustomFields(customFields);
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 (getThingIndexingMode() != null)
sb.append("ThingIndexingMode: ").append(getThingIndexingMode()).append(",");
if (getThingConnectivityIndexingMode() != null)
sb.append("ThingConnectivityIndexingMode: ").append(getThingConnectivityIndexingMode()).append(",");
if (getManagedFields() != null)
sb.append("ManagedFields: ").append(getManagedFields()).append(",");
if (getCustomFields() != null)
sb.append("CustomFields: ").append(getCustomFields());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ThingIndexingConfiguration == false)
return false;
ThingIndexingConfiguration other = (ThingIndexingConfiguration) obj;
if (other.getThingIndexingMode() == null ^ this.getThingIndexingMode() == null)
return false;
if (other.getThingIndexingMode() != null && other.getThingIndexingMode().equals(this.getThingIndexingMode()) == false)
return false;
if (other.getThingConnectivityIndexingMode() == null ^ this.getThingConnectivityIndexingMode() == null)
return false;
if (other.getThingConnectivityIndexingMode() != null
&& other.getThingConnectivityIndexingMode().equals(this.getThingConnectivityIndexingMode()) == false)
return false;
if (other.getManagedFields() == null ^ this.getManagedFields() == null)
return false;
if (other.getManagedFields() != null && other.getManagedFields().equals(this.getManagedFields()) == false)
return false;
if (other.getCustomFields() == null ^ this.getCustomFields() == null)
return false;
if (other.getCustomFields() != null && other.getCustomFields().equals(this.getCustomFields()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getThingIndexingMode() == null) ? 0 : getThingIndexingMode().hashCode());
hashCode = prime * hashCode + ((getThingConnectivityIndexingMode() == null) ? 0 : getThingConnectivityIndexingMode().hashCode());
hashCode = prime * hashCode + ((getManagedFields() == null) ? 0 : getManagedFields().hashCode());
hashCode = prime * hashCode + ((getCustomFields() == null) ? 0 : getCustomFields().hashCode());
return hashCode;
}
@Override
public ThingIndexingConfiguration clone() {
try {
return (ThingIndexingConfiguration) 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.iot.model.transform.ThingIndexingConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}