@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getIpFilter() == null) ? 0 : getIpFilter().hashCode()); return hashCode; }
/** * <p> * A single IP address or a range of IP addresses that you want to block or allow, specified in Classless * Inter-Domain Routing (CIDR) notation. An example of a single email address is 10.0.0.1. An example of a range of * IP addresses is 10.0.0.1/24. For more information about CIDR notation, see <a * href="https://tools.ietf.org/html/rfc2317">RFC 2317</a>. * </p> * * @param cidr * A single IP address or a range of IP addresses that you want to block or allow, specified in Classless * Inter-Domain Routing (CIDR) notation. An example of a single email address is 10.0.0.1. An example of a * range of IP addresses is 10.0.0.1/24. For more information about CIDR notation, see <a * href="https://tools.ietf.org/html/rfc2317">RFC 2317</a>. * @return Returns a reference to this object so that method calls can be chained together. */ public ReceiptIpFilter withCidr(String cidr) { setCidr(cidr); return this; }
public ReceiptIpFilter unmarshall(StaxUnmarshallerContext context) throws Exception { ReceiptIpFilter receiptIpFilter = new ReceiptIpFilter(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return receiptIpFilter; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Policy", targetDepth)) { receiptIpFilter.setPolicy(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Cidr", targetDepth)) { receiptIpFilter.setCidr(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return receiptIpFilter; } } } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ReceiptFilter == false) return false; ReceiptFilter other = (ReceiptFilter) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getIpFilter() == null ^ this.getIpFilter() == null) return false; if (other.getIpFilter() != null && other.getIpFilter().equals(this.getIpFilter()) == false) return false; return true; }
/** * <p> * Indicates whether to block or allow incoming mail from the specified IP addresses. * </p> * * @param policy * Indicates whether to block or allow incoming mail from the specified IP addresses. * @return Returns a reference to this object so that method calls can be chained together. * @see ReceiptFilterPolicy */ public ReceiptIpFilter withPolicy(String policy) { setPolicy(policy); return this; }
/** * <p> * Indicates whether to block or allow incoming mail from the specified IP addresses. * </p> * * @param policy * Indicates whether to block or allow incoming mail from the specified IP addresses. * @see ReceiptFilterPolicy */ public void setPolicy(ReceiptFilterPolicy policy) { withPolicy(policy); }
public ReceiptIpFilter unmarshall(StaxUnmarshallerContext context) throws Exception { ReceiptIpFilter receiptIpFilter = new ReceiptIpFilter(); 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("Policy", targetDepth)) { receiptIpFilter.setPolicy(StringStaxUnmarshaller.getInstance().unmarshall( context)); continue; } if (context.testExpression("Cidr", targetDepth)) { receiptIpFilter.setCidr(StringStaxUnmarshaller.getInstance() .unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { break; } } } return receiptIpFilter; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ReceiptFilter == false) return false; ReceiptFilter other = (ReceiptFilter) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getIpFilter() == null ^ this.getIpFilter() == null) return false; if (other.getIpFilter() != null && other.getIpFilter().equals(this.getIpFilter()) == false) return false; return true; } }
/** * <p> * Indicates whether to block or allow incoming mail from the specified IP addresses. * </p> * * @param policy * Indicates whether to block or allow incoming mail from the specified IP addresses. * @return Returns a reference to this object so that method calls can be chained together. * @see ReceiptFilterPolicy */ public ReceiptIpFilter withPolicy(String policy) { setPolicy(policy); return this; }
/** * <p> * Indicates whether to block or allow incoming mail from the specified IP addresses. * </p> * * @param policy * Indicates whether to block or allow incoming mail from the specified IP addresses. * @see ReceiptFilterPolicy */ public void setPolicy(ReceiptFilterPolicy policy) { withPolicy(policy); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ReceiptIpFilter == false) return false; ReceiptIpFilter other = (ReceiptIpFilter) obj; if (other.getPolicy() == null ^ this.getPolicy() == null) return false; if (other.getPolicy() != null && other.getPolicy().equals(this.getPolicy()) == false) return false; if (other.getCidr() == null ^ this.getCidr() == null) return false; if (other.getCidr() != null && other.getCidr().equals(this.getCidr()) == false) return false; return true; }
public ReceiptIpFilter unmarshall(StaxUnmarshallerContext context) throws Exception { ReceiptIpFilter receiptIpFilter = new ReceiptIpFilter(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return receiptIpFilter; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Policy", targetDepth)) { receiptIpFilter.setPolicy(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Cidr", targetDepth)) { receiptIpFilter.setCidr(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return receiptIpFilter; } } } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getIpFilter() == null) ? 0 : getIpFilter().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ReceiptFilter == false) return false; ReceiptFilter other = (ReceiptFilter) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getIpFilter() == null ^ this.getIpFilter() == null) return false; if (other.getIpFilter() != null && other.getIpFilter().equals(this.getIpFilter()) == false) return false; return true; }
/** * <p> * A single IP address or a range of IP addresses that you want to block or allow, specified in Classless * Inter-Domain Routing (CIDR) notation. An example of a single email address is 10.0.0.1. An example of a range of * IP addresses is 10.0.0.1/24. For more information about CIDR notation, see <a * href="https://tools.ietf.org/html/rfc2317">RFC 2317</a>. * </p> * * @param cidr * A single IP address or a range of IP addresses that you want to block or allow, specified in Classless * Inter-Domain Routing (CIDR) notation. An example of a single email address is 10.0.0.1. An example of a * range of IP addresses is 10.0.0.1/24. For more information about CIDR notation, see <a * href="https://tools.ietf.org/html/rfc2317">RFC 2317</a>. * @return Returns a reference to this object so that method calls can be chained together. */ public ReceiptIpFilter withCidr(String cidr) { setCidr(cidr); 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 (getPolicy() != null) sb.append("Policy: ").append(getPolicy()).append(","); if (getCidr() != null) sb.append("Cidr: ").append(getCidr()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getIpFilter() == null) ? 0 : getIpFilter().hashCode()); return hashCode; }
public Request<CreateReceiptFilterRequest> marshall(CreateReceiptFilterRequest createReceiptFilterRequest) { if (createReceiptFilterRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<CreateReceiptFilterRequest> request = new DefaultRequest<CreateReceiptFilterRequest>(createReceiptFilterRequest, "AmazonSimpleEmailService"); request.addParameter("Action", "CreateReceiptFilter"); request.addParameter("Version", "2010-12-01"); request.setHttpMethod(HttpMethodName.POST); { ReceiptFilter filter = createReceiptFilterRequest.getFilter(); if (filter != null) { if (filter.getName() != null) { request.addParameter("Filter.Name", StringUtils.fromString(filter.getName())); } { ReceiptIpFilter ipFilter = filter.getIpFilter(); if (ipFilter != null) { if (ipFilter.getPolicy() != null) { request.addParameter("Filter.IpFilter.Policy", StringUtils.fromString(ipFilter.getPolicy())); } if (ipFilter.getCidr() != null) { request.addParameter("Filter.IpFilter.Cidr", StringUtils.fromString(ipFilter.getCidr())); } } } } } return request; }