@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTag() == null) ? 0 : getTag().hashCode()); hashCode = prime * hashCode + ((getResourceName() == null) ? 0 : getResourceName().hashCode()); hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode()); return hashCode; }
/** * <p> * The Amazon Resource Name (ARN) with which the tag is associated, for example: * <code>arn:aws:redshift:us-east-1:123456789:cluster:t1</code>. * </p> * * @param resourceName * The Amazon Resource Name (ARN) with which the tag is associated, for example: * <code>arn:aws:redshift:us-east-1:123456789:cluster:t1</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public TaggedResource withResourceName(String resourceName) { setResourceName(resourceName); return this; }
setResourceType(resourceType); return this;
public TaggedResource unmarshall(StaxUnmarshallerContext context) throws Exception { TaggedResource taggedResource = new TaggedResource(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return taggedResource; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Tag", targetDepth)) { taggedResource.setTag(TagStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("ResourceName", targetDepth)) { taggedResource.setResourceName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("ResourceType", targetDepth)) { taggedResource.setResourceType(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return taggedResource; } } } }
/** * <p> * The tag for the resource. * </p> * * @param tag * The tag for the resource. * @return Returns a reference to this object so that method calls can be chained together. */ public TaggedResource withTag(Tag tag) { setTag(tag); return this; }
public TaggedResource unmarshall(StaxUnmarshallerContext context) throws Exception { TaggedResource taggedResource = new TaggedResource(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return taggedResource; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Tag", targetDepth)) { taggedResource.setTag(TagStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("ResourceName", targetDepth)) { taggedResource.setResourceName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("ResourceType", targetDepth)) { taggedResource.setResourceType(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return taggedResource; } } } }
/** * <p> * The tag for the resource. * </p> * * @param tag * The tag for the resource. * @return Returns a reference to this object so that method calls can be chained together. */ public TaggedResource withTag(Tag tag) { setTag(tag); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TaggedResource == false) return false; TaggedResource other = (TaggedResource) obj; if (other.getTag() == null ^ this.getTag() == null) return false; if (other.getTag() != null && other.getTag().equals(this.getTag()) == false) return false; if (other.getResourceName() == null ^ this.getResourceName() == null) return false; if (other.getResourceName() != null && other.getResourceName().equals(this.getResourceName()) == false) return false; if (other.getResourceType() == null ^ this.getResourceType() == null) return false; if (other.getResourceType() != null && other.getResourceType().equals(this.getResourceType()) == false) return false; return true; }
/** * <p> * The Amazon Resource Name (ARN) with which the tag is associated, for example: * <code>arn:aws:redshift:us-east-1:123456789:cluster:t1</code>. * </p> * * @param resourceName * The Amazon Resource Name (ARN) with which the tag is associated, for example: * <code>arn:aws:redshift:us-east-1:123456789:cluster:t1</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public TaggedResource withResourceName(String resourceName) { setResourceName(resourceName); return this; }
setResourceType(resourceType); 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 (getTag() != null) sb.append("Tag: ").append(getTag()).append(","); if (getResourceName() != null) sb.append("ResourceName: ").append(getResourceName()).append(","); if (getResourceType() != null) sb.append("ResourceType: ").append(getResourceType()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTag() == null) ? 0 : getTag().hashCode()); hashCode = prime * hashCode + ((getResourceName() == null) ? 0 : getResourceName().hashCode()); hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TaggedResource == false) return false; TaggedResource other = (TaggedResource) obj; if (other.getTag() == null ^ this.getTag() == null) return false; if (other.getTag() != null && other.getTag().equals(this.getTag()) == false) return false; if (other.getResourceName() == null ^ this.getResourceName() == null) return false; if (other.getResourceName() != null && other.getResourceName().equals(this.getResourceName()) == false) return false; if (other.getResourceType() == null ^ this.getResourceType() == null) return false; if (other.getResourceType() != null && other.getResourceType().equals(this.getResourceType()) == false) return false; return true; }
/** * 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 (getTag() != null) sb.append("Tag: ").append(getTag()).append(","); if (getResourceName() != null) sb.append("ResourceName: ").append(getResourceName()).append(","); if (getResourceType() != null) sb.append("ResourceType: ").append(getResourceType()); sb.append("}"); return sb.toString(); }