|
| 1 | +/* |
| 2 | + * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"). |
| 5 | + * You may not use this file except in compliance with the License. |
| 6 | + * A copy of the License is located at |
| 7 | + * |
| 8 | + * http://aws.amazon.com/apache2.0 |
| 9 | + * |
| 10 | + * or in the "license" file accompanying this file. This file is distributed |
| 11 | + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 12 | + * express or implied. See the License for the specific language governing |
| 13 | + * permissions and limitations under the License. |
| 14 | + */ |
| 15 | + |
| 16 | +package com.amazonaws.services.iot.model; |
| 17 | + |
| 18 | +import java.io.Serializable; |
| 19 | + |
| 20 | +/** |
| 21 | + * <p> |
| 22 | + * Parameters used when defining a mitigation action that move a set of things |
| 23 | + * to a thing group. |
| 24 | + * </p> |
| 25 | + */ |
| 26 | +public class AddThingsToThingGroupParams implements Serializable { |
| 27 | + /** |
| 28 | + * <p> |
| 29 | + * The list of groups to which you want to add the things that triggered the |
| 30 | + * mitigation action. You can add a thing to a maximum of 10 groups, but you |
| 31 | + * cannot add a thing to more than one group in the same hierarchy. |
| 32 | + * </p> |
| 33 | + */ |
| 34 | + private java.util.List<String> thingGroupNames; |
| 35 | + |
| 36 | + /** |
| 37 | + * <p> |
| 38 | + * Specifies if this mitigation action can move the things that triggered |
| 39 | + * the mitigation action even if they are part of one or more dynamic things |
| 40 | + * groups. |
| 41 | + * </p> |
| 42 | + */ |
| 43 | + private Boolean overrideDynamicGroups; |
| 44 | + |
| 45 | + /** |
| 46 | + * <p> |
| 47 | + * The list of groups to which you want to add the things that triggered the |
| 48 | + * mitigation action. You can add a thing to a maximum of 10 groups, but you |
| 49 | + * cannot add a thing to more than one group in the same hierarchy. |
| 50 | + * </p> |
| 51 | + * |
| 52 | + * @return <p> |
| 53 | + * The list of groups to which you want to add the things that |
| 54 | + * triggered the mitigation action. You can add a thing to a maximum |
| 55 | + * of 10 groups, but you cannot add a thing to more than one group |
| 56 | + * in the same hierarchy. |
| 57 | + * </p> |
| 58 | + */ |
| 59 | + public java.util.List<String> getThingGroupNames() { |
| 60 | + return thingGroupNames; |
| 61 | + } |
| 62 | + |
| 63 | + /** |
| 64 | + * <p> |
| 65 | + * The list of groups to which you want to add the things that triggered the |
| 66 | + * mitigation action. You can add a thing to a maximum of 10 groups, but you |
| 67 | + * cannot add a thing to more than one group in the same hierarchy. |
| 68 | + * </p> |
| 69 | + * |
| 70 | + * @param thingGroupNames <p> |
| 71 | + * The list of groups to which you want to add the things that |
| 72 | + * triggered the mitigation action. You can add a thing to a |
| 73 | + * maximum of 10 groups, but you cannot add a thing to more than |
| 74 | + * one group in the same hierarchy. |
| 75 | + * </p> |
| 76 | + */ |
| 77 | + public void setThingGroupNames(java.util.Collection<String> thingGroupNames) { |
| 78 | + if (thingGroupNames == null) { |
| 79 | + this.thingGroupNames = null; |
| 80 | + return; |
| 81 | + } |
| 82 | + |
| 83 | + this.thingGroupNames = new java.util.ArrayList<String>(thingGroupNames); |
| 84 | + } |
| 85 | + |
| 86 | + /** |
| 87 | + * <p> |
| 88 | + * The list of groups to which you want to add the things that triggered the |
| 89 | + * mitigation action. You can add a thing to a maximum of 10 groups, but you |
| 90 | + * cannot add a thing to more than one group in the same hierarchy. |
| 91 | + * </p> |
| 92 | + * <p> |
| 93 | + * Returns a reference to this object so that method calls can be chained |
| 94 | + * together. |
| 95 | + * |
| 96 | + * @param thingGroupNames <p> |
| 97 | + * The list of groups to which you want to add the things that |
| 98 | + * triggered the mitigation action. You can add a thing to a |
| 99 | + * maximum of 10 groups, but you cannot add a thing to more than |
| 100 | + * one group in the same hierarchy. |
| 101 | + * </p> |
| 102 | + * @return A reference to this updated object so that method calls can be |
| 103 | + * chained together. |
| 104 | + */ |
| 105 | + public AddThingsToThingGroupParams withThingGroupNames(String... thingGroupNames) { |
| 106 | + if (getThingGroupNames() == null) { |
| 107 | + this.thingGroupNames = new java.util.ArrayList<String>(thingGroupNames.length); |
| 108 | + } |
| 109 | + for (String value : thingGroupNames) { |
| 110 | + this.thingGroupNames.add(value); |
| 111 | + } |
| 112 | + return this; |
| 113 | + } |
| 114 | + |
| 115 | + /** |
| 116 | + * <p> |
| 117 | + * The list of groups to which you want to add the things that triggered the |
| 118 | + * mitigation action. You can add a thing to a maximum of 10 groups, but you |
| 119 | + * cannot add a thing to more than one group in the same hierarchy. |
| 120 | + * </p> |
| 121 | + * <p> |
| 122 | + * Returns a reference to this object so that method calls can be chained |
| 123 | + * together. |
| 124 | + * |
| 125 | + * @param thingGroupNames <p> |
| 126 | + * The list of groups to which you want to add the things that |
| 127 | + * triggered the mitigation action. You can add a thing to a |
| 128 | + * maximum of 10 groups, but you cannot add a thing to more than |
| 129 | + * one group in the same hierarchy. |
| 130 | + * </p> |
| 131 | + * @return A reference to this updated object so that method calls can be |
| 132 | + * chained together. |
| 133 | + */ |
| 134 | + public AddThingsToThingGroupParams withThingGroupNames( |
| 135 | + java.util.Collection<String> thingGroupNames) { |
| 136 | + setThingGroupNames(thingGroupNames); |
| 137 | + return this; |
| 138 | + } |
| 139 | + |
| 140 | + /** |
| 141 | + * <p> |
| 142 | + * Specifies if this mitigation action can move the things that triggered |
| 143 | + * the mitigation action even if they are part of one or more dynamic things |
| 144 | + * groups. |
| 145 | + * </p> |
| 146 | + * |
| 147 | + * @return <p> |
| 148 | + * Specifies if this mitigation action can move the things that |
| 149 | + * triggered the mitigation action even if they are part of one or |
| 150 | + * more dynamic things groups. |
| 151 | + * </p> |
| 152 | + */ |
| 153 | + public Boolean isOverrideDynamicGroups() { |
| 154 | + return overrideDynamicGroups; |
| 155 | + } |
| 156 | + |
| 157 | + /** |
| 158 | + * <p> |
| 159 | + * Specifies if this mitigation action can move the things that triggered |
| 160 | + * the mitigation action even if they are part of one or more dynamic things |
| 161 | + * groups. |
| 162 | + * </p> |
| 163 | + * |
| 164 | + * @return <p> |
| 165 | + * Specifies if this mitigation action can move the things that |
| 166 | + * triggered the mitigation action even if they are part of one or |
| 167 | + * more dynamic things groups. |
| 168 | + * </p> |
| 169 | + */ |
| 170 | + public Boolean getOverrideDynamicGroups() { |
| 171 | + return overrideDynamicGroups; |
| 172 | + } |
| 173 | + |
| 174 | + /** |
| 175 | + * <p> |
| 176 | + * Specifies if this mitigation action can move the things that triggered |
| 177 | + * the mitigation action even if they are part of one or more dynamic things |
| 178 | + * groups. |
| 179 | + * </p> |
| 180 | + * |
| 181 | + * @param overrideDynamicGroups <p> |
| 182 | + * Specifies if this mitigation action can move the things that |
| 183 | + * triggered the mitigation action even if they are part of one |
| 184 | + * or more dynamic things groups. |
| 185 | + * </p> |
| 186 | + */ |
| 187 | + public void setOverrideDynamicGroups(Boolean overrideDynamicGroups) { |
| 188 | + this.overrideDynamicGroups = overrideDynamicGroups; |
| 189 | + } |
| 190 | + |
| 191 | + /** |
| 192 | + * <p> |
| 193 | + * Specifies if this mitigation action can move the things that triggered |
| 194 | + * the mitigation action even if they are part of one or more dynamic things |
| 195 | + * groups. |
| 196 | + * </p> |
| 197 | + * <p> |
| 198 | + * Returns a reference to this object so that method calls can be chained |
| 199 | + * together. |
| 200 | + * |
| 201 | + * @param overrideDynamicGroups <p> |
| 202 | + * Specifies if this mitigation action can move the things that |
| 203 | + * triggered the mitigation action even if they are part of one |
| 204 | + * or more dynamic things groups. |
| 205 | + * </p> |
| 206 | + * @return A reference to this updated object so that method calls can be |
| 207 | + * chained together. |
| 208 | + */ |
| 209 | + public AddThingsToThingGroupParams withOverrideDynamicGroups(Boolean overrideDynamicGroups) { |
| 210 | + this.overrideDynamicGroups = overrideDynamicGroups; |
| 211 | + return this; |
| 212 | + } |
| 213 | + |
| 214 | + /** |
| 215 | + * Returns a string representation of this object; useful for testing and |
| 216 | + * debugging. |
| 217 | + * |
| 218 | + * @return A string representation of this object. |
| 219 | + * @see java.lang.Object#toString() |
| 220 | + */ |
| 221 | + @Override |
| 222 | + public String toString() { |
| 223 | + StringBuilder sb = new StringBuilder(); |
| 224 | + sb.append("{"); |
| 225 | + if (getThingGroupNames() != null) |
| 226 | + sb.append("thingGroupNames: " + getThingGroupNames() + ","); |
| 227 | + if (getOverrideDynamicGroups() != null) |
| 228 | + sb.append("overrideDynamicGroups: " + getOverrideDynamicGroups()); |
| 229 | + sb.append("}"); |
| 230 | + return sb.toString(); |
| 231 | + } |
| 232 | + |
| 233 | + @Override |
| 234 | + public int hashCode() { |
| 235 | + final int prime = 31; |
| 236 | + int hashCode = 1; |
| 237 | + |
| 238 | + hashCode = prime * hashCode |
| 239 | + + ((getThingGroupNames() == null) ? 0 : getThingGroupNames().hashCode()); |
| 240 | + hashCode = prime |
| 241 | + * hashCode |
| 242 | + + ((getOverrideDynamicGroups() == null) ? 0 : getOverrideDynamicGroups().hashCode()); |
| 243 | + return hashCode; |
| 244 | + } |
| 245 | + |
| 246 | + @Override |
| 247 | + public boolean equals(Object obj) { |
| 248 | + if (this == obj) |
| 249 | + return true; |
| 250 | + if (obj == null) |
| 251 | + return false; |
| 252 | + |
| 253 | + if (obj instanceof AddThingsToThingGroupParams == false) |
| 254 | + return false; |
| 255 | + AddThingsToThingGroupParams other = (AddThingsToThingGroupParams) obj; |
| 256 | + |
| 257 | + if (other.getThingGroupNames() == null ^ this.getThingGroupNames() == null) |
| 258 | + return false; |
| 259 | + if (other.getThingGroupNames() != null |
| 260 | + && other.getThingGroupNames().equals(this.getThingGroupNames()) == false) |
| 261 | + return false; |
| 262 | + if (other.getOverrideDynamicGroups() == null ^ this.getOverrideDynamicGroups() == null) |
| 263 | + return false; |
| 264 | + if (other.getOverrideDynamicGroups() != null |
| 265 | + && other.getOverrideDynamicGroups().equals(this.getOverrideDynamicGroups()) == false) |
| 266 | + return false; |
| 267 | + return true; |
| 268 | + } |
| 269 | +} |
0 commit comments