@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getInternetGateways() == null) ? 0 : getInternetGateways().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeInternetGatewaysResult == false) return false; DescribeInternetGatewaysResult other = (DescribeInternetGatewaysResult) obj; if (other.getInternetGateways() == null ^ this.getInternetGateways() == null) return false; if (other.getInternetGateways() != null && other.getInternetGateways().equals(this.getInternetGateways()) == 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 (getInternetGateways() != null) sb.append("InternetGateways: ").append(getInternetGateways()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeInternetGatewaysResult == false) return false; DescribeInternetGatewaysResult other = (DescribeInternetGatewaysResult)obj; if (other.getInternetGateways() == null ^ this.getInternetGateways() == null) return false; if (other.getInternetGateways() != null && other.getInternetGateways().equals(this.getInternetGateways()) == false) return false; return true; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getInternetGateways() == null) ? 0 : getInternetGateways().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 (getInternetGateways() != null) sb.append("InternetGateways: " + getInternetGateways() ); sb.append("}"); return sb.toString(); }
/** * Information about one or more Internet gateways. * <p> * Returns a reference to this object so that method calls can be chained together. * * @param internetGateways Information about one or more Internet gateways. * * @return A reference to this updated object so that method calls can be chained * together. */ public DescribeInternetGatewaysResult withInternetGateways(InternetGateway... internetGateways) { if (getInternetGateways() == null) setInternetGateways(new java.util.ArrayList<InternetGateway>(internetGateways.length)); for (InternetGateway value : internetGateways) { getInternetGateways().add(value); } return this; }
public DescribeInternetGatewaysResult unmarshall(StaxUnmarshallerContext context) throws Exception { DescribeInternetGatewaysResult describeInternetGatewaysResult = new DescribeInternetGatewaysResult(); 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 describeInternetGatewaysResult; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("internetGatewaySet/item", targetDepth)) { describeInternetGatewaysResult.getInternetGateways().add(InternetGatewayStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { return describeInternetGatewaysResult; } } } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getInternetGateways() == null) ? 0 : getInternetGateways().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeInternetGatewaysResult == false) return false; DescribeInternetGatewaysResult other = (DescribeInternetGatewaysResult) obj; if (other.getInternetGateways() == null ^ this.getInternetGateways() == null) return false; if (other.getInternetGateways() != null && other.getInternetGateways().equals(this.getInternetGateways()) == 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 (getInternetGateways() != null) sb.append("InternetGateways: ").append(getInternetGateways()); sb.append("}"); return sb.toString(); }
/** * * @param gatewayIds * @param ec2Client * @return */ public List<InternetGateway> getInternetGateways(List<String> gatewayIds, AmazonEC2 ec2Client) { DescribeInternetGatewaysRequest request = new DescribeInternetGatewaysRequest(); if (gatewayIds != null && !gatewayIds.isEmpty()) { request = request.withInternetGatewayIds(gatewayIds); } DescribeInternetGatewaysResult result = ec2Client.describeInternetGateways(request); return result.getInternetGateways(); }
public boolean existsInAws() { boolean result = false; DescribeInternetGatewaysRequest req = new DescribeInternetGatewaysRequest().withInternetGatewayIds(getId()); if (context.fetchEC2Client().describeInternetGateways(req).getInternetGateways().isEmpty()) { log.error("InternetGateway ( " + getId() + " ) does not exist in AWS!"); } else { result = true; } return result; }
@Override protected void doScan() { AmazonEC2Client ec2 = getClient(); GraphNodeGarbageCollector gc = newGarbageCollector().bindScannerContext(); ec2.describeInternetGateways().getInternetGateways().forEach(c -> scanInternetGateway(gc, c)); }
if(!skipRegions.contains(region.getName())){ ec2Client = AmazonEC2ClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(temporaryCredentials)).withRegion(region.getName()).build(); List<InternetGateway> internetGatewayList = ec2Client.describeInternetGateways().getInternetGateways();