/* * Copyright 2010-2023 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; /** *

* Thing group indexing configuration. *

*/ public class ThingGroupIndexingConfiguration implements Serializable { /** *

* Thing group indexing mode. *

*

* Constraints:
* Allowed Values: OFF, ON */ private String thingGroupIndexingMode; /** *

* Contains fields that are indexed and whose types are already known by the * Fleet Indexing service. This is an optional field. For more information, * see Managed fields in the Amazon Web Services IoT Core Developer * Guide. *

*/ private java.util.List managedFields; /** *

* A list of thing group fields to index. This list cannot contain any * managed fields. Use the GetIndexingConfiguration API to get a list of * managed fields. *

*

* Contains custom field names and their data type. *

*/ private java.util.List customFields; /** *

* Thing group indexing mode. *

*

* Constraints:
* Allowed Values: OFF, ON * * @return

* Thing group indexing mode. *

* @see ThingGroupIndexingMode */ public String getThingGroupIndexingMode() { return thingGroupIndexingMode; } /** *

* Thing group indexing mode. *

*

* Constraints:
* Allowed Values: OFF, ON * * @param thingGroupIndexingMode

* Thing group indexing mode. *

* @see ThingGroupIndexingMode */ public void setThingGroupIndexingMode(String thingGroupIndexingMode) { this.thingGroupIndexingMode = thingGroupIndexingMode; } /** *

* Thing group indexing mode. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: OFF, ON * * @param thingGroupIndexingMode

* Thing group indexing mode. *

* @return A reference to this updated object so that method calls can be * chained together. * @see ThingGroupIndexingMode */ public ThingGroupIndexingConfiguration withThingGroupIndexingMode(String thingGroupIndexingMode) { this.thingGroupIndexingMode = thingGroupIndexingMode; return this; } /** *

* Thing group indexing mode. *

*

* Constraints:
* Allowed Values: OFF, ON * * @param thingGroupIndexingMode

* Thing group indexing mode. *

* @see ThingGroupIndexingMode */ public void setThingGroupIndexingMode(ThingGroupIndexingMode thingGroupIndexingMode) { this.thingGroupIndexingMode = thingGroupIndexingMode.toString(); } /** *

* Thing group indexing mode. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: OFF, ON * * @param thingGroupIndexingMode

* Thing group indexing mode. *

* @return A reference to this updated object so that method calls can be * chained together. * @see ThingGroupIndexingMode */ public ThingGroupIndexingConfiguration withThingGroupIndexingMode( ThingGroupIndexingMode thingGroupIndexingMode) { this.thingGroupIndexingMode = thingGroupIndexingMode.toString(); return this; } /** *

* Contains fields that are indexed and whose types are already known by the * Fleet Indexing service. This is an optional field. For more information, * see Managed fields in the Amazon Web Services IoT Core Developer * Guide. *

* * @return

* Contains fields that are indexed and whose types are already * known by the Fleet Indexing service. This is an optional field. * For more information, see Managed fields in the Amazon Web Services IoT Core * Developer Guide. *

*/ public java.util.List getManagedFields() { return managedFields; } /** *

* Contains fields that are indexed and whose types are already known by the * Fleet Indexing service. This is an optional field. For more information, * see Managed fields in the Amazon Web Services IoT Core Developer * Guide. *

* * @param managedFields

* Contains fields that are indexed and whose types are already * known by the Fleet Indexing service. This is an optional * field. For more information, see Managed fields in the Amazon Web Services IoT Core * Developer Guide. *

*/ 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. This is an optional field. For more information, * see Managed fields in the Amazon Web Services IoT Core Developer * Guide. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param managedFields

* Contains fields that are indexed and whose types are already * known by the Fleet Indexing service. This is an optional * field. For more information, see Managed fields in the Amazon Web Services IoT Core * Developer Guide. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ThingGroupIndexingConfiguration withManagedFields(Field... managedFields) { if (getManagedFields() == null) { this.managedFields = new java.util.ArrayList(managedFields.length); } for (Field value : managedFields) { this.managedFields.add(value); } return this; } /** *

* Contains fields that are indexed and whose types are already known by the * Fleet Indexing service. This is an optional field. For more information, * see Managed fields in the Amazon Web Services IoT Core Developer * Guide. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param managedFields

* Contains fields that are indexed and whose types are already * known by the Fleet Indexing service. This is an optional * field. For more information, see Managed fields in the Amazon Web Services IoT Core * Developer Guide. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ThingGroupIndexingConfiguration withManagedFields( java.util.Collection managedFields) { setManagedFields(managedFields); return this; } /** *

* A list of thing group fields to index. This list cannot contain any * managed fields. Use the GetIndexingConfiguration API to get a list of * managed fields. *

*

* Contains custom field names and their data type. *

* * @return

* A list of thing group fields to index. This list cannot contain * any managed fields. Use the GetIndexingConfiguration API to get a * list of managed fields. *

*

* Contains custom field names and their data type. *

*/ public java.util.List getCustomFields() { return customFields; } /** *

* A list of thing group fields to index. This list cannot contain any * managed fields. Use the GetIndexingConfiguration API to get a list of * managed fields. *

*

* Contains custom field names and their data type. *

* * @param customFields

* A list of thing group fields to index. This list cannot * contain any managed fields. Use the GetIndexingConfiguration * API to get a list of managed fields. *

*

* 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); } /** *

* A list of thing group fields to index. This list cannot contain any * managed fields. Use the GetIndexingConfiguration API to get a list of * managed fields. *

*

* Contains custom field names and their data type. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param customFields

* A list of thing group fields to index. This list cannot * contain any managed fields. Use the GetIndexingConfiguration * API to get a list of managed fields. *

*

* Contains custom field names and their data type. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ThingGroupIndexingConfiguration withCustomFields(Field... customFields) { if (getCustomFields() == null) { this.customFields = new java.util.ArrayList(customFields.length); } for (Field value : customFields) { this.customFields.add(value); } return this; } /** *

* A list of thing group fields to index. This list cannot contain any * managed fields. Use the GetIndexingConfiguration API to get a list of * managed fields. *

*

* Contains custom field names and their data type. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param customFields

* A list of thing group fields to index. This list cannot * contain any managed fields. Use the GetIndexingConfiguration * API to get a list of managed fields. *

*

* Contains custom field names and their data type. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ThingGroupIndexingConfiguration withCustomFields(java.util.Collection customFields) { setCustomFields(customFields); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getThingGroupIndexingMode() != null) sb.append("thingGroupIndexingMode: " + getThingGroupIndexingMode() + ","); if (getManagedFields() != null) sb.append("managedFields: " + getManagedFields() + ","); if (getCustomFields() != null) sb.append("customFields: " + getCustomFields()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getThingGroupIndexingMode() == null) ? 0 : getThingGroupIndexingMode() .hashCode()); hashCode = prime * hashCode + ((getManagedFields() == null) ? 0 : getManagedFields().hashCode()); hashCode = prime * hashCode + ((getCustomFields() == null) ? 0 : getCustomFields().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ThingGroupIndexingConfiguration == false) return false; ThingGroupIndexingConfiguration other = (ThingGroupIndexingConfiguration) obj; if (other.getThingGroupIndexingMode() == null ^ this.getThingGroupIndexingMode() == null) return false; if (other.getThingGroupIndexingMode() != null && other.getThingGroupIndexingMode().equals(this.getThingGroupIndexingMode()) == 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; } }