/* * 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; /** *
* Parameters used when defining a mitigation action that move a set of things * to a thing group. *
*/ public class AddThingsToThingGroupParams implements Serializable { /** ** The list of groups to which you want to add the things that triggered the * mitigation action. You can add a thing to a maximum of 10 groups, but you * can't add a thing to more than one group in the same hierarchy. *
*/ private java.util.List* Specifies if this mitigation action can move the things that triggered * the mitigation action even if they are part of one or more dynamic thing * groups. *
*/ private Boolean overrideDynamicGroups; /** ** The list of groups to which you want to add the things that triggered the * mitigation action. You can add a thing to a maximum of 10 groups, but you * can't add a thing to more than one group in the same hierarchy. *
* * @return* The list of groups to which you want to add the things that * triggered the mitigation action. You can add a thing to a maximum * of 10 groups, but you can't add a thing to more than one group in * the same hierarchy. *
*/ public java.util.List* The list of groups to which you want to add the things that triggered the * mitigation action. You can add a thing to a maximum of 10 groups, but you * can't add a thing to more than one group in the same hierarchy. *
* * @param thingGroupNames* The list of groups to which you want to add the things that * triggered the mitigation action. You can add a thing to a * maximum of 10 groups, but you can't add a thing to more than * one group in the same hierarchy. *
*/ public void setThingGroupNames(java.util.Collection* The list of groups to which you want to add the things that triggered the * mitigation action. You can add a thing to a maximum of 10 groups, but you * can't add a thing to more than one group in the same hierarchy. *
** Returns a reference to this object so that method calls can be chained * together. * * @param thingGroupNames
* The list of groups to which you want to add the things that * triggered the mitigation action. You can add a thing to a * maximum of 10 groups, but you can't add a thing to more than * one group in the same hierarchy. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AddThingsToThingGroupParams withThingGroupNames(String... thingGroupNames) { if (getThingGroupNames() == null) { this.thingGroupNames = new java.util.ArrayList* The list of groups to which you want to add the things that triggered the * mitigation action. You can add a thing to a maximum of 10 groups, but you * can't add a thing to more than one group in the same hierarchy. *
** Returns a reference to this object so that method calls can be chained * together. * * @param thingGroupNames
* The list of groups to which you want to add the things that * triggered the mitigation action. You can add a thing to a * maximum of 10 groups, but you can't add a thing to more than * one group in the same hierarchy. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AddThingsToThingGroupParams withThingGroupNames( java.util.Collection* Specifies if this mitigation action can move the things that triggered * the mitigation action even if they are part of one or more dynamic thing * groups. *
* * @return* Specifies if this mitigation action can move the things that * triggered the mitigation action even if they are part of one or * more dynamic thing groups. *
*/ public Boolean isOverrideDynamicGroups() { return overrideDynamicGroups; } /** ** Specifies if this mitigation action can move the things that triggered * the mitigation action even if they are part of one or more dynamic thing * groups. *
* * @return* Specifies if this mitigation action can move the things that * triggered the mitigation action even if they are part of one or * more dynamic thing groups. *
*/ public Boolean getOverrideDynamicGroups() { return overrideDynamicGroups; } /** ** Specifies if this mitigation action can move the things that triggered * the mitigation action even if they are part of one or more dynamic thing * groups. *
* * @param overrideDynamicGroups* Specifies if this mitigation action can move the things that * triggered the mitigation action even if they are part of one * or more dynamic thing groups. *
*/ public void setOverrideDynamicGroups(Boolean overrideDynamicGroups) { this.overrideDynamicGroups = overrideDynamicGroups; } /** ** Specifies if this mitigation action can move the things that triggered * the mitigation action even if they are part of one or more dynamic thing * groups. *
** Returns a reference to this object so that method calls can be chained * together. * * @param overrideDynamicGroups
* Specifies if this mitigation action can move the things that * triggered the mitigation action even if they are part of one * or more dynamic thing groups. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AddThingsToThingGroupParams withOverrideDynamicGroups(Boolean overrideDynamicGroups) { this.overrideDynamicGroups = overrideDynamicGroups; 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 (getThingGroupNames() != null) sb.append("thingGroupNames: " + getThingGroupNames() + ","); if (getOverrideDynamicGroups() != null) sb.append("overrideDynamicGroups: " + getOverrideDynamicGroups()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getThingGroupNames() == null) ? 0 : getThingGroupNames().hashCode()); hashCode = prime * hashCode + ((getOverrideDynamicGroups() == null) ? 0 : getOverrideDynamicGroups().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AddThingsToThingGroupParams == false) return false; AddThingsToThingGroupParams other = (AddThingsToThingGroupParams) obj; if (other.getThingGroupNames() == null ^ this.getThingGroupNames() == null) return false; if (other.getThingGroupNames() != null && other.getThingGroupNames().equals(this.getThingGroupNames()) == false) return false; if (other.getOverrideDynamicGroups() == null ^ this.getOverrideDynamicGroups() == null) return false; if (other.getOverrideDynamicGroups() != null && other.getOverrideDynamicGroups().equals(this.getOverrideDynamicGroups()) == false) return false; return true; } }