@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; }
/** * <p> * Information about the <a>RateBasedRule</a> that you specified in the <code>GetRateBasedRule</code> request. * </p> * * @param rule * Information about the <a>RateBasedRule</a> that you specified in the <code>GetRateBasedRule</code> * request. * @return Returns a reference to this object so that method calls can be chained together. */ public GetRateBasedRuleResult withRule(RateBasedRule rule) { setRule(rule); return this; }
public GetRateBasedRuleResult unmarshall(JsonUnmarshallerContext context) throws Exception { GetRateBasedRuleResult getRateBasedRuleResult = new GetRateBasedRuleResult(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return getRateBasedRuleResult; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Rule", targetDepth)) { context.nextToken(); getRateBasedRuleResult.setRule(RateBasedRuleJsonUnmarshaller.getInstance().unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return getRateBasedRuleResult; }
public GetRateBasedRuleResult unmarshall(JsonUnmarshallerContext context) throws Exception { GetRateBasedRuleResult getRateBasedRuleResult = new GetRateBasedRuleResult(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return getRateBasedRuleResult; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Rule", targetDepth)) { context.nextToken(); getRateBasedRuleResult.setRule(RateBasedRuleJsonUnmarshaller.getInstance().unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return getRateBasedRuleResult; }
/** * 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 (getRule() != null) sb.append("Rule: ").append(getRule()); sb.append("}"); return sb.toString(); }