@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; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getInternetGateway() == null) ? 0 : getInternetGateway().hashCode()); return hashCode; }
/** * <p> * Any VPCs attached to the internet gateway. * </p> * * @param attachments * Any VPCs attached to the internet gateway. * @return Returns a reference to this object so that method calls can be chained together. */ public InternetGateway withAttachments(java.util.Collection<InternetGatewayAttachment> attachments) { setAttachments(attachments); return this; }
@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; } } } }
public InternetGateway unmarshall(StaxUnmarshallerContext context) throws Exception { InternetGateway internetGateway = new InternetGateway(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; internetGateway.withAttachments(new ArrayList<InternetGatewayAttachment>()); continue; internetGateway.withAttachments(InternetGatewayAttachmentStaxUnmarshaller.getInstance().unmarshall(context)); continue; internetGateway.setInternetGatewayId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; internetGateway.setOwnerId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; internetGateway.withTags(new ArrayList<Tag>()); continue; internetGateway.withTags(TagStaxUnmarshaller.getInstance().unmarshall(context)); continue;
/** * 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; }
/** * Any tags assigned to the Internet gateway. * <p> * Returns a reference to this object so that method calls can be chained together. * * @param tags Any tags assigned to the Internet gateway. * * @return A reference to this updated object so that method calls can be chained * together. */ public InternetGateway withTags(Tag... tags) { if (getTags() == null) setTags(new java.util.ArrayList<Tag>(tags.length)); for (Tag value : tags) { getTags().add(value); } return this; }
/** * <p> * Any tags assigned to the internet gateway. * </p> * * @param tags * Any tags assigned to the internet gateway. * @return Returns a reference to this object so that method calls can be chained together. */ public InternetGateway withTags(java.util.Collection<Tag> tags) { setTags(tags); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateInternetGatewayResult == false) return false; CreateInternetGatewayResult other = (CreateInternetGatewayResult) obj; if (other.getInternetGateway() == null ^ this.getInternetGateway() == null) return false; if (other.getInternetGateway() != null && other.getInternetGateway().equals(this.getInternetGateway()) == false) return false; return true; }
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; }
/** * Creates an internetGateway and returns the id it was created with. * * @param ec2Client * @return InternetGatewayId */ public String createInternetGateway(AmazonEC2 ec2Client) { String gatewayId = null; CreateInternetGatewayRequest request = new CreateInternetGatewayRequest(); CreateInternetGatewayResult result = ec2Client.createInternetGateway(request); if (result != null && result.getInternetGateway() != null) { gatewayId = result.getInternetGateway().getInternetGatewayId(); } return gatewayId; }
/** * <p> * The ID of the internet gateway. * </p> * * @param internetGatewayId * The ID of the internet gateway. * @return Returns a reference to this object so that method calls can be chained together. */ public InternetGateway withInternetGatewayId(String internetGatewayId) { setInternetGatewayId(internetGatewayId); 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; }
public InternetGateway unmarshall(StaxUnmarshallerContext context) throws Exception { InternetGateway internetGateway = new InternetGateway(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; internetGateway.withAttachments(new ArrayList<InternetGatewayAttachment>()); continue; internetGateway.withAttachments(InternetGatewayAttachmentStaxUnmarshaller.getInstance().unmarshall(context)); continue; internetGateway.setInternetGatewayId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; internetGateway.setOwnerId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; internetGateway.withTags(new ArrayList<Tag>()); continue; internetGateway.withTags(TagStaxUnmarshaller.getInstance().unmarshall(context)); continue;
/** * <p> * Any tags assigned to the internet gateway. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. * </p> * * @param tags * Any tags assigned to the internet gateway. * @return Returns a reference to this object so that method calls can be chained together. */ public InternetGateway withTags(Tag... tags) { if (this.tags == null) { setTags(new com.amazonaws.internal.SdkInternalList<Tag>(tags.length)); } for (Tag ele : tags) { this.tags.add(ele); } return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateInternetGatewayResult == false) return false; CreateInternetGatewayResult other = (CreateInternetGatewayResult)obj; if (other.getInternetGateway() == null ^ this.getInternetGateway() == null) return false; if (other.getInternetGateway() != null && other.getInternetGateway().equals(this.getInternetGateway()) == false) return false; return true; }
/** * <p> * The ID of the internet gateway. * </p> * * @param internetGatewayId * The ID of the internet gateway. * @return Returns a reference to this object so that method calls can be chained together. */ public InternetGateway withInternetGatewayId(String internetGatewayId) { setInternetGatewayId(internetGatewayId); return this; }
@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; }
/** * 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(); }