@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode()); return hashCode; }
/** * <p> * The attributes that are currently set for the account. * </p> * * @param attributes * The attributes that are currently set for the account. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeAccountAttributesResult withAttributes(java.util.Collection<AccountAttribute> attributes) { setAttributes(attributes); return this; }
public DescribeAccountAttributesResult unmarshall(JsonUnmarshallerContext context) throws Exception { DescribeAccountAttributesResult describeAccountAttributesResult = new DescribeAccountAttributesResult(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return describeAccountAttributesResult; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Attributes", targetDepth)) { context.nextToken(); describeAccountAttributesResult.setAttributes(new ListUnmarshaller<AccountAttribute>(AccountAttributeJsonUnmarshaller.getInstance()) .unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return describeAccountAttributesResult; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeAccountAttributesResult == false) return false; DescribeAccountAttributesResult other = (DescribeAccountAttributesResult) obj; if (other.getAttributes() == null ^ this.getAttributes() == null) return false; if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == false) return false; return true; }
/** * <p> * The attributes that are currently set for the account. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setAttributes(java.util.Collection)} or {@link #withAttributes(java.util.Collection)} if you want to * override the existing values. * </p> * * @param attributes * The attributes that are currently set for the account. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeAccountAttributesResult withAttributes(AccountAttribute... attributes) { if (this.attributes == null) { setAttributes(new java.util.ArrayList<AccountAttribute>(attributes.length)); } for (AccountAttribute ele : attributes) { this.attributes.add(ele); } 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 (getAttributes() != null) sb.append("Attributes: ").append(getAttributes()); sb.append("}"); return sb.toString(); }