@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDomainNames() == null) ? 0 : getDomainNames().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); return hashCode; }
/** * A list of domain names that match the expression. * * @param domainNames * A list of domain names that match the expression. * @return Returns a reference to this object so that method calls can be chained together. */ public ListDomainsResult withDomainNames(java.util.Collection<String> domainNames) { setDomainNames(domainNames); return this; }
/** * An opaque token indicating that there are more domains than the specified <code>MaxNumberOfDomains</code> still * available. * * @param nextToken * An opaque token indicating that there are more domains than the specified <code>MaxNumberOfDomains</code> * still available. * @return Returns a reference to this object so that method calls can be chained together. */ public ListDomainsResult withNextToken(String nextToken) { setNextToken(nextToken); return this; }
/** * A list of domain names that match the expression. * <p> * Returns a reference to this object so that method calls can be chained together. * * @param domainNames A list of domain names that match the expression. * * @return A reference to this updated object so that method calls can be chained * together. */ public ListDomainsResult withDomainNames(String... domainNames) { if (getDomainNames() == null) setDomainNames(new java.util.ArrayList<String>(domainNames.length)); for (String value : domainNames) { getDomainNames().add(value); } return this; }
public ListDomainsResult unmarshall(StaxUnmarshallerContext context) throws Exception { ListDomainsResult listDomainsResult = new ListDomainsResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) return listDomainsResult; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("DomainName", targetDepth)) { listDomainsResult.getDomainNames().add(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("NextToken", targetDepth)) { listDomainsResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { return listDomainsResult; } } } }
@Override public List<String> getDomains() throws TranslatorException { return client.listDomains().getDomainNames(); }
public ListDomainsResult unmarshall(StaxUnmarshallerContext context) throws Exception { ListDomainsResult listDomainsResult = new ListDomainsResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return listDomainsResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("DomainName", targetDepth)) { listDomainsResult.withDomainNames(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("NextToken", targetDepth)) { listDomainsResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return listDomainsResult; } } } }
public static void createDomain(AmazonSimpleDBClient client, String domainName) throws InterruptedException { client.createDomain(new CreateDomainRequest(domainName)); // Unfortunatly, there is no waiters for domain create int retries = 10; List<String> domainNames = client.listDomains().getDomainNames(); while (!domainNames.contains(domainName) && 0 < retries--) { Thread.sleep(500); domainNames = client.listDomains().getDomainNames(); } Assert.assertTrue(domainNames.contains(domainName)); }
public ListDomainsResult unmarshall(StaxUnmarshallerContext context) throws Exception { ListDomainsResult listDomainsResult = new ListDomainsResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return listDomainsResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("DomainName", targetDepth)) { listDomainsResult.withDomainNames(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("NextToken", targetDepth)) { listDomainsResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return listDomainsResult; } } } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListDomainsResult == false) return false; ListDomainsResult other = (ListDomainsResult) obj; if (other.getDomainNames() == null ^ this.getDomainNames() == null) return false; if (other.getDomainNames() != null && other.getDomainNames().equals(this.getDomainNames()) == false) return false; if (other.getNextToken() == null ^ this.getNextToken() == null) return false; if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false) return false; return true; }
public static void createDomain(AmazonSimpleDBClient client, String domainName) throws InterruptedException { client.createDomain(new CreateDomainRequest(domainName)); // Unfortunatly, there is no waiters for domain create int retries = 10; List<String> domainNames = client.listDomains().getDomainNames(); while (!domainNames.contains(domainName) && 0 < retries--) { Thread.sleep(500); domainNames = client.listDomains().getDomainNames(); } Assert.assertTrue(domainNames.contains(domainName)); }
/** * A list of domain names that match the expression. * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setDomainNames(java.util.Collection)} or {@link #withDomainNames(java.util.Collection)} if you want to * override the existing values. * </p> * * @param domainNames * A list of domain names that match the expression. * @return Returns a reference to this object so that method calls can be chained together. */ public ListDomainsResult withDomainNames(String... domainNames) { if (this.domainNames == null) { setDomainNames(new com.amazonaws.internal.SdkInternalList<String>(domainNames.length)); } for (String ele : domainNames) { this.domainNames.add(ele); } return this; }
/** * An opaque token indicating that there are more domains than the specified <code>MaxNumberOfDomains</code> still * available. * * @param nextToken * An opaque token indicating that there are more domains than the specified <code>MaxNumberOfDomains</code> * still available. * @return Returns a reference to this object so that method calls can be chained together. */ public ListDomainsResult withNextToken(String nextToken) { setNextToken(nextToken); 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 (getDomainNames() != null) sb.append("DomainNames: ").append(getDomainNames()).append(","); if (getNextToken() != null) sb.append("NextToken: ").append(getNextToken()); sb.append("}"); return sb.toString(); }
/** * A list of domain names that match the expression. * * @param domainNames * A list of domain names that match the expression. * @return Returns a reference to this object so that method calls can be chained together. */ public ListDomainsResult withDomainNames(java.util.Collection<String> domainNames) { setDomainNames(domainNames); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListDomainsResult == false) return false; ListDomainsResult other = (ListDomainsResult)obj; if (other.getDomainNames() == null ^ this.getDomainNames() == null) return false; if (other.getDomainNames() != null && other.getDomainNames().equals(this.getDomainNames()) == false) return false; if (other.getNextToken() == null ^ this.getNextToken() == null) return false; if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false) return false; return true; }
/** * A list of domain names that match the expression. * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setDomainNames(java.util.Collection)} or {@link #withDomainNames(java.util.Collection)} if you want to * override the existing values. * </p> * * @param domainNames * A list of domain names that match the expression. * @return Returns a reference to this object so that method calls can be chained together. */ public ListDomainsResult withDomainNames(String... domainNames) { if (this.domainNames == null) { setDomainNames(new com.amazonaws.internal.SdkInternalList<String>(domainNames.length)); } for (String ele : domainNames) { this.domainNames.add(ele); } return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDomainNames() == null) ? 0 : getDomainNames().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().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 (getDomainNames() != null) sb.append("DomainNames: " + getDomainNames() + ","); if (getNextToken() != null) sb.append("NextToken: " + getNextToken() ); sb.append("}"); return sb.toString(); }
assertNotNull(listDomainsResult.getDomainNames()); assertTrue(listDomainsResult.getDomainNames().size() == 2); for (Object domainNamesObject : listDomainsResult.getDomainNames()) { String domainNames = (String)domainNamesObject; assertNotNull(listDomainsResult.getNextToken()); assertTrue(listDomainsResult.getNextToken().equals("1"));