@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAttachments() == null) ? 0 : getAttachments().hashCode()); hashCode = prime * hashCode + ((getInternetGatewayId() == null) ? 0 : getInternetGatewayId().hashCode()); hashCode = prime * hashCode + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; }
/** * 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 (getAttachments() != null) sb.append("Attachments: ").append(getAttachments()).append(","); if (getInternetGatewayId() != null) sb.append("InternetGatewayId: ").append(getInternetGatewayId()).append(","); if (getOwnerId() != null) sb.append("OwnerId: ").append(getOwnerId()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof InternetGateway == false) return false; InternetGateway other = (InternetGateway) obj; if (other.getAttachments() == null ^ this.getAttachments() == null) return false; if (other.getAttachments() != null && other.getAttachments().equals(this.getAttachments()) == false) return false; if (other.getInternetGatewayId() == null ^ this.getInternetGatewayId() == null) return false; if (other.getInternetGatewayId() != null && other.getInternetGatewayId().equals(this.getInternetGatewayId()) == false) return false; if (other.getOwnerId() == null ^ this.getOwnerId() == null) return false; if (other.getOwnerId() != null && other.getOwnerId().equals(this.getOwnerId()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; }
/** * Any VPCs attached to the Internet gateway. * <p> * Returns a reference to this object so that method calls can be chained together. * * @param attachments Any VPCs attached to the Internet gateway. * * @return A reference to this updated object so that method calls can be chained * together. */ public InternetGateway withAttachments(InternetGatewayAttachment... attachments) { if (getAttachments() == null) setAttachments(new java.util.ArrayList<InternetGatewayAttachment>(attachments.length)); for (InternetGatewayAttachment value : attachments) { getAttachments().add(value); } return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getInternetGatewayId() == null) ? 0 : getInternetGatewayId().hashCode()); hashCode = prime * hashCode + ((getAttachments() == null) ? 0 : getAttachments().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; }
/** * 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 (getInternetGatewayId() != null) sb.append("InternetGatewayId: " + getInternetGatewayId() + ","); if (getAttachments() != null) sb.append("Attachments: " + getAttachments() + ","); if (getTags() != null) sb.append("Tags: " + getTags() ); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof InternetGateway == false) return false; InternetGateway other = (InternetGateway)obj; if (other.getInternetGatewayId() == null ^ this.getInternetGatewayId() == null) return false; if (other.getInternetGatewayId() != null && other.getInternetGatewayId().equals(this.getInternetGatewayId()) == false) return false; if (other.getAttachments() == null ^ this.getAttachments() == null) return false; if (other.getAttachments() != null && other.getAttachments().equals(this.getAttachments()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; }
public InternetGateway unmarshall(StaxUnmarshallerContext context) throws Exception { InternetGateway internetGateway = new InternetGateway(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) return internetGateway; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("internetGatewayId", targetDepth)) { internetGateway.setInternetGatewayId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("attachmentSet/item", targetDepth)) { internetGateway.getAttachments().add(InternetGatewayAttachmentStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("tagSet/item", targetDepth)) { internetGateway.getTags().add(TagStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { return internetGateway; } } } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAttachments() == null) ? 0 : getAttachments().hashCode()); hashCode = prime * hashCode + ((getInternetGatewayId() == null) ? 0 : getInternetGatewayId().hashCode()); hashCode = prime * hashCode + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; }
/** * 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 (getAttachments() != null) sb.append("Attachments: ").append(getAttachments()).append(","); if (getInternetGatewayId() != null) sb.append("InternetGatewayId: ").append(getInternetGatewayId()).append(","); if (getOwnerId() != null) sb.append("OwnerId: ").append(getOwnerId()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()); sb.append("}"); return sb.toString(); }
public boolean verify() { // will return false if the id is null boolean result = false; if (gatewayId != null) { if (ec2Client == null) { ec2Client = context.fetchEC2Client(); } List<String> id = new ArrayList<String>(); id.add(gatewayId); List<InternetGateway> gateways = helper.getInternetGateways(id, ec2Client); if (gateways != null && !gateways.isEmpty()) { for (InternetGateway gateway : gateways) { List<InternetGatewayAttachment> attachments = gateway.getAttachments(); if (attachments != null && !attachments.isEmpty()) { for (InternetGatewayAttachment attachment : attachments) { String attachedVpc = attachment.getVpcId(); if (vpcId.equals(attachedVpc)) { result = true; } } } } } } return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof InternetGateway == false) return false; InternetGateway other = (InternetGateway) obj; if (other.getAttachments() == null ^ this.getAttachments() == null) return false; if (other.getAttachments() != null && other.getAttachments().equals(this.getAttachments()) == false) return false; if (other.getInternetGatewayId() == null ^ this.getInternetGatewayId() == null) return false; if (other.getInternetGatewayId() != null && other.getInternetGatewayId().equals(this.getInternetGatewayId()) == false) return false; if (other.getOwnerId() == null ^ this.getOwnerId() == null) return false; if (other.getOwnerId() != null && other.getOwnerId().equals(this.getOwnerId()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; }