@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSubscriptions() == null) ? 0 : getSubscriptions().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); return hashCode; }
/** * <p> * Token to pass along to the next <code>ListSubscriptions</code> request. This element is returned if there are * more subscriptions to retrieve. * </p> * * @param nextToken * Token to pass along to the next <code>ListSubscriptions</code> request. This element is returned if there * are more subscriptions to retrieve. * @return Returns a reference to this object so that method calls can be chained together. */ public ListSubscriptionsResult withNextToken(String nextToken) { setNextToken(nextToken); return this; }
/** * <p> * A list of subscriptions. * </p> * * @param subscriptions * A list of subscriptions. * @return Returns a reference to this object so that method calls can be chained together. */ public ListSubscriptionsResult withSubscriptions(java.util.Collection<Subscription> subscriptions) { setSubscriptions(subscriptions); return this; }
public ListSubscriptionsResult unmarshall(StaxUnmarshallerContext context) throws Exception { ListSubscriptionsResult listSubscriptionsResult = new ListSubscriptionsResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return listSubscriptionsResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Subscriptions", targetDepth)) { listSubscriptionsResult.withSubscriptions(new ArrayList<Subscription>()); continue; } if (context.testExpression("Subscriptions/member", targetDepth)) { listSubscriptionsResult.withSubscriptions(SubscriptionStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("NextToken", targetDepth)) { listSubscriptionsResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return listSubscriptionsResult; } } } }
/** * <p> * A list of subscriptions. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param subscriptions <p> * A list of subscriptions. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListSubscriptionsResult withSubscriptions(Subscription... subscriptions) { if (getSubscriptions() == null) { this.subscriptions = new java.util.ArrayList<Subscription>(subscriptions.length); } for (Subscription value : subscriptions) { this.subscriptions.add(value); } return this; }
public ListSubscriptionsResult unmarshall(StaxUnmarshallerContext context) throws Exception { ListSubscriptionsResult listSubscriptionsResult = new ListSubscriptionsResult(); 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("Subscriptions/member", targetDepth)) { listSubscriptionsResult.withSubscriptions(SubscriptionStaxUnmarshaller .getInstance().unmarshall(context)); continue; } if (context.testExpression("NextToken", targetDepth)) { listSubscriptionsResult.setNextToken(StringStaxUnmarshaller.getInstance() .unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { break; } } } return listSubscriptionsResult; }
/** * <p> * A list of subscriptions. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param subscriptions <p> * A list of subscriptions. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListSubscriptionsResult withSubscriptions(Subscription... subscriptions) { if (getSubscriptions() == null) { this.subscriptions = new java.util.ArrayList<Subscription>(subscriptions.length); } for (Subscription value : subscriptions) { this.subscriptions.add(value); } return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListSubscriptionsResult == false) return false; ListSubscriptionsResult other = (ListSubscriptionsResult) obj; if (other.getSubscriptions() == null ^ this.getSubscriptions() == null) return false; if (other.getSubscriptions() != null && other.getSubscriptions().equals(this.getSubscriptions()) == 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 ListSubscriptionsResult unmarshall(StaxUnmarshallerContext context) throws Exception { ListSubscriptionsResult listSubscriptionsResult = new ListSubscriptionsResult(); 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("Subscriptions/member", targetDepth)) { listSubscriptionsResult.withSubscriptions(SubscriptionStaxUnmarshaller .getInstance().unmarshall(context)); continue; } if (context.testExpression("NextToken", targetDepth)) { listSubscriptionsResult.setNextToken(StringStaxUnmarshaller.getInstance() .unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { break; } } } return listSubscriptionsResult; }
ListSubscriptionsResult listResult = snsClient.listSubscriptions(); List<Subscription> subscriptions = listResult.getSubscriptions(); String arn=""; for (Subscription subs : subscriptions) { if(subs.getProtocol().equals("sms") && subs.getEndpoint().equals("12712438216")) { arn = subs.getTopicArn(); break; } } if(!arn.equals("")) { snsClient.unsubscribe(arn); }
/** * <p> * A list of subscriptions. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setSubscriptions(java.util.Collection)} or {@link #withSubscriptions(java.util.Collection)} if you want * to override the existing values. * </p> * * @param subscriptions * A list of subscriptions. * @return Returns a reference to this object so that method calls can be chained together. */ public ListSubscriptionsResult withSubscriptions(Subscription... subscriptions) { if (this.subscriptions == null) { setSubscriptions(new com.amazonaws.internal.SdkInternalList<Subscription>(subscriptions.length)); } for (Subscription ele : subscriptions) { this.subscriptions.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 (getSubscriptions() != null) sb.append("Subscriptions: ").append(getSubscriptions()).append(","); if (getNextToken() != null) sb.append("NextToken: ").append(getNextToken()); sb.append("}"); return sb.toString(); }
/** * <p> * A list of subscriptions. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param subscriptions <p> * A list of subscriptions. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListSubscriptionsResult withSubscriptions( java.util.Collection<Subscription> subscriptions) { setSubscriptions(subscriptions); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSubscriptions() == null) ? 0 : getSubscriptions().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); return hashCode; }
/** * <p> * A list of subscriptions. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param subscriptions <p> * A list of subscriptions. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListSubscriptionsResult withSubscriptions( java.util.Collection<Subscription> subscriptions) { setSubscriptions(subscriptions); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListSubscriptionsResult == false) return false; ListSubscriptionsResult other = (ListSubscriptionsResult) obj; if (other.getSubscriptions() == null ^ this.getSubscriptions() == null) return false; if (other.getSubscriptions() != null && other.getSubscriptions().equals(this.getSubscriptions()) == 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 (getSubscriptions() != null) sb.append("Subscriptions: " + getSubscriptions() + ","); 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 + ((getSubscriptions() == null) ? 0 : getSubscriptions().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 ListSubscriptionsResult == false) return false; ListSubscriptionsResult other = (ListSubscriptionsResult) obj; if (other.getSubscriptions() == null ^ this.getSubscriptions() == null) return false; if (other.getSubscriptions() != null && other.getSubscriptions().equals(this.getSubscriptions()) == 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 (getSubscriptions() != null) sb.append("Subscriptions: " + getSubscriptions() + ","); if (getNextToken() != null) sb.append("NextToken: " + getNextToken()); sb.append("}"); return sb.toString(); }