@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRuleId() == null) ? 0 : getRuleId().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode()); hashCode = prime * hashCode + ((getMatchPredicates() == null) ? 0 : getMatchPredicates().hashCode()); hashCode = prime * hashCode + ((getRateKey() == null) ? 0 : getRateKey().hashCode()); hashCode = prime * hashCode + ((getRateLimit() == null) ? 0 : getRateLimit().hashCode()); return hashCode; }
/** * <p> * The <code>Predicates</code> object contains one <code>Predicate</code> element for each <a>ByteMatchSet</a>, * <a>IPSet</a>, or <a>SqlInjectionMatchSet</a> object that you want to include in a <code>RateBasedRule</code>. * </p> * * @param matchPredicates * The <code>Predicates</code> object contains one <code>Predicate</code> element for each * <a>ByteMatchSet</a>, <a>IPSet</a>, or <a>SqlInjectionMatchSet</a> object that you want to include in a * <code>RateBasedRule</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public RateBasedRule withMatchPredicates(java.util.Collection<Predicate> matchPredicates) { setMatchPredicates(matchPredicates); return this; }
public RateBasedRule unmarshall(JsonUnmarshallerContext context) throws Exception { RateBasedRule rateBasedRule = new RateBasedRule(); if (context.testExpression("RuleId", targetDepth)) { context.nextToken(); rateBasedRule.setRuleId(context.getUnmarshaller(String.class).unmarshall(context)); rateBasedRule.setName(context.getUnmarshaller(String.class).unmarshall(context)); rateBasedRule.setMetricName(context.getUnmarshaller(String.class).unmarshall(context)); rateBasedRule.setMatchPredicates(new ListUnmarshaller<Predicate>(PredicateJsonUnmarshaller.getInstance()).unmarshall(context)); rateBasedRule.setRateKey(context.getUnmarshaller(String.class).unmarshall(context)); rateBasedRule.setRateLimit(context.getUnmarshaller(Long.class).unmarshall(context));
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRule() == null) ? 0 : getRule().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetRateBasedRuleResult == false) return false; GetRateBasedRuleResult other = (GetRateBasedRuleResult) obj; if (other.getRule() == null ^ this.getRule() == null) return false; if (other.getRule() != null && other.getRule().equals(this.getRule()) == false) return false; return true; }
public RateBasedRule unmarshall(JsonUnmarshallerContext context) throws Exception { RateBasedRule rateBasedRule = new RateBasedRule(); if (context.testExpression("RuleId", targetDepth)) { context.nextToken(); rateBasedRule.setRuleId(context.getUnmarshaller(String.class).unmarshall(context)); rateBasedRule.setName(context.getUnmarshaller(String.class).unmarshall(context)); rateBasedRule.setMetricName(context.getUnmarshaller(String.class).unmarshall(context)); rateBasedRule.setMatchPredicates(new ListUnmarshaller<Predicate>(PredicateJsonUnmarshaller.getInstance()).unmarshall(context)); rateBasedRule.setRateKey(context.getUnmarshaller(String.class).unmarshall(context)); rateBasedRule.setRateLimit(context.getUnmarshaller(Long.class).unmarshall(context));
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRule() == null) ? 0 : getRule().hashCode()); hashCode = prime * hashCode + ((getChangeToken() == null) ? 0 : getChangeToken().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateRateBasedRuleResult == false) return false; CreateRateBasedRuleResult other = (CreateRateBasedRuleResult) obj; if (other.getRule() == null ^ this.getRule() == null) return false; if (other.getRule() != null && other.getRule().equals(this.getRule()) == false) return false; if (other.getChangeToken() == null ^ this.getChangeToken() == null) return false; if (other.getChangeToken() != null && other.getChangeToken().equals(this.getChangeToken()) == false) return false; return true; }
return false; RateBasedRule other = (RateBasedRule) obj; if (other.getRuleId() == null ^ this.getRuleId() == null) return false; if (other.getRuleId() != null && other.getRuleId().equals(this.getRuleId()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getMetricName() == null ^ this.getMetricName() == null) return false; if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == false) return false; if (other.getMatchPredicates() == null ^ this.getMatchPredicates() == null) return false; if (other.getMatchPredicates() != null && other.getMatchPredicates().equals(this.getMatchPredicates()) == false) return false; if (other.getRateKey() == null ^ this.getRateKey() == null) return false; if (other.getRateKey() != null && other.getRateKey().equals(this.getRateKey()) == false) return false; if (other.getRateLimit() == null ^ this.getRateLimit() == null) return false; if (other.getRateLimit() != null && other.getRateLimit().equals(this.getRateLimit()) == false) return false; return true;
/** * <p> * The <code>Predicates</code> object contains one <code>Predicate</code> element for each <a>ByteMatchSet</a>, * <a>IPSet</a>, or <a>SqlInjectionMatchSet</a> object that you want to include in a <code>RateBasedRule</code>. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setMatchPredicates(java.util.Collection)} or {@link #withMatchPredicates(java.util.Collection)} if you * want to override the existing values. * </p> * * @param matchPredicates * The <code>Predicates</code> object contains one <code>Predicate</code> element for each * <a>ByteMatchSet</a>, <a>IPSet</a>, or <a>SqlInjectionMatchSet</a> object that you want to include in a * <code>RateBasedRule</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public RateBasedRule withMatchPredicates(Predicate... matchPredicates) { if (this.matchPredicates == null) { setMatchPredicates(new java.util.ArrayList<Predicate>(matchPredicates.length)); } for (Predicate ele : matchPredicates) { this.matchPredicates.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 (getRuleId() != null) sb.append("RuleId: ").append(getRuleId()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getMetricName() != null) sb.append("MetricName: ").append(getMetricName()).append(","); if (getMatchPredicates() != null) sb.append("MatchPredicates: ").append(getMatchPredicates()).append(","); if (getRateKey() != null) sb.append("RateKey: ").append(getRateKey()).append(","); if (getRateLimit() != null) sb.append("RateLimit: ").append(getRateLimit()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(RateBasedRule rateBasedRule, ProtocolMarshaller protocolMarshaller) { if (rateBasedRule == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(rateBasedRule.getRuleId(), RULEID_BINDING); protocolMarshaller.marshall(rateBasedRule.getName(), NAME_BINDING); protocolMarshaller.marshall(rateBasedRule.getMetricName(), METRICNAME_BINDING); protocolMarshaller.marshall(rateBasedRule.getMatchPredicates(), MATCHPREDICATES_BINDING); protocolMarshaller.marshall(rateBasedRule.getRateKey(), RATEKEY_BINDING); protocolMarshaller.marshall(rateBasedRule.getRateLimit(), RATELIMIT_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
/** * Marshall the given parameter object. */ public void marshall(RateBasedRule rateBasedRule, ProtocolMarshaller protocolMarshaller) { if (rateBasedRule == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(rateBasedRule.getRuleId(), RULEID_BINDING); protocolMarshaller.marshall(rateBasedRule.getName(), NAME_BINDING); protocolMarshaller.marshall(rateBasedRule.getMetricName(), METRICNAME_BINDING); protocolMarshaller.marshall(rateBasedRule.getMatchPredicates(), MATCHPREDICATES_BINDING); protocolMarshaller.marshall(rateBasedRule.getRateKey(), RATEKEY_BINDING); protocolMarshaller.marshall(rateBasedRule.getRateLimit(), RATELIMIT_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }