@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; }
/** * 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); } }