@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getResourceArn() == null) ? 0 : getResourceArn().hashCode()); hashCode = prime * hashCode + ((getTopicArn() == null) ? 0 : getTopicArn().hashCode()); hashCode = prime * hashCode + ((getEventSubscriptions() == null) ? 0 : getEventSubscriptions().hashCode()); return hashCode; }
/** * <p> * The list of existing event subscriptions. * </p> * * @param eventSubscriptions * The list of existing event subscriptions. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withEventSubscriptions(java.util.Collection<EventSubscription> eventSubscriptions) { setEventSubscriptions(eventSubscriptions); return this; }
/** * <p> * The ARN of the assessment template that is used during the event for which the SNS notification is sent. * </p> * * @param resourceArn * The ARN of the assessment template that is used during the event for which the SNS notification is sent. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withResourceArn(String resourceArn) { setResourceArn(resourceArn); return this; }
public Subscription unmarshall(JsonUnmarshallerContext context) throws Exception { Subscription subscription = new Subscription(); if (context.testExpression("resourceArn", targetDepth)) { context.nextToken(); subscription.setResourceArn(context.getUnmarshaller(String.class).unmarshall(context)); subscription.setTopicArn(context.getUnmarshaller(String.class).unmarshall(context)); subscription.setEventSubscriptions(new ListUnmarshaller<EventSubscription>(EventSubscriptionJsonUnmarshaller.getInstance()) .unmarshall(context));
/** * <p> * The ARN of the Amazon Simple Notification Service (SNS) topic to which the SNS notifications are sent. * </p> * * @param topicArn * The ARN of the Amazon Simple Notification Service (SNS) topic to which the SNS notifications are sent. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withTopicArn(String topicArn) { setTopicArn(topicArn); return this; }
public Subscription unmarshall(JsonUnmarshallerContext context) throws Exception { Subscription subscription = new Subscription(); if (context.testExpression("resourceArn", targetDepth)) { context.nextToken(); subscription.setResourceArn(context.getUnmarshaller(String.class).unmarshall(context)); subscription.setTopicArn(context.getUnmarshaller(String.class).unmarshall(context)); subscription.setEventSubscriptions(new ListUnmarshaller<EventSubscription>(EventSubscriptionJsonUnmarshaller.getInstance()) .unmarshall(context));
/** * <p> * The ARN of the Amazon Simple Notification Service (SNS) topic to which the SNS notifications are sent. * </p> * * @param topicArn * The ARN of the Amazon Simple Notification Service (SNS) topic to which the SNS notifications are sent. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withTopicArn(String topicArn) { setTopicArn(topicArn); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Subscription == false) return false; Subscription other = (Subscription) obj; if (other.getResourceArn() == null ^ this.getResourceArn() == null) return false; if (other.getResourceArn() != null && other.getResourceArn().equals(this.getResourceArn()) == false) return false; if (other.getTopicArn() == null ^ this.getTopicArn() == null) return false; if (other.getTopicArn() != null && other.getTopicArn().equals(this.getTopicArn()) == false) return false; if (other.getEventSubscriptions() == null ^ this.getEventSubscriptions() == null) return false; if (other.getEventSubscriptions() != null && other.getEventSubscriptions().equals(this.getEventSubscriptions()) == false) return false; return true; }
/** * <p> * The list of existing event subscriptions. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setEventSubscriptions(java.util.Collection)} or {@link #withEventSubscriptions(java.util.Collection)} if * you want to override the existing values. * </p> * * @param eventSubscriptions * The list of existing event subscriptions. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withEventSubscriptions(EventSubscription... eventSubscriptions) { if (this.eventSubscriptions == null) { setEventSubscriptions(new java.util.ArrayList<EventSubscription>(eventSubscriptions.length)); } for (EventSubscription ele : eventSubscriptions) { this.eventSubscriptions.add(ele); } return this; }
/** * <p> * The ARN of the assessment template that is used during the event for which the SNS notification is sent. * </p> * * @param resourceArn * The ARN of the assessment template that is used during the event for which the SNS notification is sent. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withResourceArn(String resourceArn) { setResourceArn(resourceArn); 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 (getResourceArn() != null) sb.append("ResourceArn: ").append(getResourceArn()).append(","); if (getTopicArn() != null) sb.append("TopicArn: ").append(getTopicArn()).append(","); if (getEventSubscriptions() != null) sb.append("EventSubscriptions: ").append(getEventSubscriptions()); sb.append("}"); return sb.toString(); }
/** * <p> * The list of existing event subscriptions. * </p> * * @param eventSubscriptions * The list of existing event subscriptions. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withEventSubscriptions(java.util.Collection<EventSubscription> eventSubscriptions) { setEventSubscriptions(eventSubscriptions); return this; }
/** * Marshall the given parameter object. */ public void marshall(Subscription subscription, ProtocolMarshaller protocolMarshaller) { if (subscription == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(subscription.getResourceArn(), RESOURCEARN_BINDING); protocolMarshaller.marshall(subscription.getTopicArn(), TOPICARN_BINDING); protocolMarshaller.marshall(subscription.getEventSubscriptions(), EVENTSUBSCRIPTIONS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
/** * <p> * The list of existing event subscriptions. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setEventSubscriptions(java.util.Collection)} or {@link #withEventSubscriptions(java.util.Collection)} if * you want to override the existing values. * </p> * * @param eventSubscriptions * The list of existing event subscriptions. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withEventSubscriptions(EventSubscription... eventSubscriptions) { if (this.eventSubscriptions == null) { setEventSubscriptions(new java.util.ArrayList<EventSubscription>(eventSubscriptions.length)); } for (EventSubscription ele : eventSubscriptions) { this.eventSubscriptions.add(ele); } return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getResourceArn() == null) ? 0 : getResourceArn().hashCode()); hashCode = prime * hashCode + ((getTopicArn() == null) ? 0 : getTopicArn().hashCode()); hashCode = prime * hashCode + ((getEventSubscriptions() == null) ? 0 : getEventSubscriptions().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Subscription == false) return false; Subscription other = (Subscription) obj; if (other.getResourceArn() == null ^ this.getResourceArn() == null) return false; if (other.getResourceArn() != null && other.getResourceArn().equals(this.getResourceArn()) == false) return false; if (other.getTopicArn() == null ^ this.getTopicArn() == null) return false; if (other.getTopicArn() != null && other.getTopicArn().equals(this.getTopicArn()) == false) return false; if (other.getEventSubscriptions() == null ^ this.getEventSubscriptions() == null) return false; if (other.getEventSubscriptions() != null && other.getEventSubscriptions().equals(this.getEventSubscriptions()) == 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 (getResourceArn() != null) sb.append("ResourceArn: ").append(getResourceArn()).append(","); if (getTopicArn() != null) sb.append("TopicArn: ").append(getTopicArn()).append(","); if (getEventSubscriptions() != null) sb.append("EventSubscriptions: ").append(getEventSubscriptions()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(Subscription subscription, ProtocolMarshaller protocolMarshaller) { if (subscription == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(subscription.getResourceArn(), RESOURCEARN_BINDING); protocolMarshaller.marshall(subscription.getTopicArn(), TOPICARN_BINDING); protocolMarshaller.marshall(subscription.getEventSubscriptions(), EVENTSUBSCRIPTIONS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }