@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTopics() == null) ? 0 : getTopics().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); return hashCode; }
public ListTopicsResult unmarshall(StaxUnmarshallerContext context) throws Exception { ListTopicsResult listTopicsResult = new ListTopicsResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return listTopicsResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Topics", targetDepth)) { listTopicsResult.withTopics(new ArrayList<Topic>()); continue; } if (context.testExpression("Topics/member", targetDepth)) { listTopicsResult.withTopics(TopicStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("NextToken", targetDepth)) { listTopicsResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return listTopicsResult; } } } }
/** * <p> * A list of topic ARNs. * </p> * * @param topics * A list of topic ARNs. * @return Returns a reference to this object so that method calls can be chained together. */ public ListTopicsResult withTopics(java.util.Collection<Topic> topics) { setTopics(topics); return this; }
String topicArn = null; for ( Topic topic : listTopicsResult.getTopics() ) { String arn = topic.getTopicArn();
/** * <p> * Token to pass along to the next <code>ListTopics</code> request. This element is returned if there are additional * topics to retrieve. * </p> * * @param nextToken * Token to pass along to the next <code>ListTopics</code> request. This element is returned if there are * additional topics to retrieve. * @return Returns a reference to this object so that method calls can be chained together. */ public ListTopicsResult withNextToken(String nextToken) { setNextToken(nextToken); return this; }
/** * <p> * A list of topic ARNs. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param topics <p> * A list of topic ARNs. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListTopicsResult withTopics(Topic... topics) { if (getTopics() == null) { this.topics = new java.util.ArrayList<Topic>(topics.length); } for (Topic value : topics) { this.topics.add(value); } return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListTopicsResult == false) return false; ListTopicsResult other = (ListTopicsResult) obj; if (other.getTopics() == null ^ this.getTopics() == null) return false; if (other.getTopics() != null && other.getTopics().equals(this.getTopics()) == 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; }
/** * <p> * A list of topic ARNs. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param topics <p> * A list of topic ARNs. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListTopicsResult withTopics(Topic... topics) { if (getTopics() == null) { this.topics = new java.util.ArrayList<Topic>(topics.length); } for (Topic value : topics) { this.topics.add(value); } return this; }
public ListTopicsResult unmarshall(StaxUnmarshallerContext context) throws Exception { ListTopicsResult listTopicsResult = new ListTopicsResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) break; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("Topics/member", targetDepth)) { listTopicsResult.withTopics(TopicStaxUnmarshaller.getInstance().unmarshall( context)); continue; } if (context.testExpression("NextToken", targetDepth)) { listTopicsResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall( context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { break; } } } return listTopicsResult; }
/** * <p> * A list of topic ARNs. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setTopics(java.util.Collection)} or {@link #withTopics(java.util.Collection)} if you want to override the * existing values. * </p> * * @param topics * A list of topic ARNs. * @return Returns a reference to this object so that method calls can be chained together. */ public ListTopicsResult withTopics(Topic... topics) { if (this.topics == null) { setTopics(new com.amazonaws.internal.SdkInternalList<Topic>(topics.length)); } for (Topic ele : topics) { this.topics.add(ele); } 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 (getTopics() != null) sb.append("Topics: ").append(getTopics()).append(","); if (getNextToken() != null) sb.append("NextToken: ").append(getNextToken()); sb.append("}"); return sb.toString(); }
@Override public Collection<NevadoTopic> listTopics() throws JMSException { Collection<NevadoTopic> topics; ListTopicsResult result; try { result = _amazonSNS.listTopics(); } catch (AmazonClientException e) { throw handleAWSException("Unable to list topics", e); } topics = new HashSet<NevadoTopic>(result.getTopics().size()); for(Topic topic : result.getTopics()) { topics.add(new NevadoTopic(topic.getTopicArn())); } return topics; }
public ListTopicsResult unmarshall(StaxUnmarshallerContext context) throws Exception { ListTopicsResult listTopicsResult = new ListTopicsResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) break; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("Topics/member", targetDepth)) { listTopicsResult.withTopics(TopicStaxUnmarshaller.getInstance().unmarshall( context)); continue; } if (context.testExpression("NextToken", targetDepth)) { listTopicsResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall( context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { break; } } } return listTopicsResult; }
/** * <p> * A list of topic ARNs. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param topics <p> * A list of topic ARNs. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListTopicsResult withTopics(java.util.Collection<Topic> topics) { setTopics(topics); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTopics() == null) ? 0 : getTopics().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); return hashCode; }
/** * <p> * A list of topic ARNs. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param topics <p> * A list of topic ARNs. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListTopicsResult withTopics(java.util.Collection<Topic> topics) { setTopics(topics); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListTopicsResult == false) return false; ListTopicsResult other = (ListTopicsResult) obj; if (other.getTopics() == null ^ this.getTopics() == null) return false; if (other.getTopics() != null && other.getTopics().equals(this.getTopics()) == 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; } }
/** * 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 (getTopics() != null) sb.append("Topics: " + getTopics() + ","); if (getNextToken() != null) sb.append("NextToken: " + getNextToken()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTopics() == null) ? 0 : getTopics().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListTopicsResult == false) return false; ListTopicsResult other = (ListTopicsResult) obj; if (other.getTopics() == null ^ this.getTopics() == null) return false; if (other.getTopics() != null && other.getTopics().equals(this.getTopics()) == 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; } }