@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRequest() == null) ? 0 : getRequest().hashCode()); hashCode = prime * hashCode + ((getWeight() == null) ? 0 : getWeight().hashCode()); hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); hashCode = prime * hashCode + ((getAction() == null) ? 0 : getAction().hashCode()); hashCode = prime * hashCode + ((getRuleWithinRuleGroup() == null) ? 0 : getRuleWithinRuleGroup().hashCode()); return hashCode; }
/** * <p> * The action for the <code>Rule</code> that the request matched: <code>ALLOW</code>, <code>BLOCK</code>, or * <code>COUNT</code>. * </p> * * @param action * The action for the <code>Rule</code> that the request matched: <code>ALLOW</code>, <code>BLOCK</code>, or * <code>COUNT</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public SampledHTTPRequest withAction(String action) { setAction(action); return this; }
/** * <p> * A complex type that contains detailed information about the request. * </p> * * @param request * A complex type that contains detailed information about the request. * @return Returns a reference to this object so that method calls can be chained together. */ public SampledHTTPRequest withRequest(HTTPRequest request) { setRequest(request); return this; }
public SampledHTTPRequest unmarshall(JsonUnmarshallerContext context) throws Exception { SampledHTTPRequest sampledHTTPRequest = new SampledHTTPRequest(); if (context.testExpression("Request", targetDepth)) { context.nextToken(); sampledHTTPRequest.setRequest(HTTPRequestJsonUnmarshaller.getInstance().unmarshall(context)); sampledHTTPRequest.setWeight(context.getUnmarshaller(Long.class).unmarshall(context)); sampledHTTPRequest.setTimestamp(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context)); sampledHTTPRequest.setAction(context.getUnmarshaller(String.class).unmarshall(context)); sampledHTTPRequest.setRuleWithinRuleGroup(context.getUnmarshaller(String.class).unmarshall(context));
/** * <p> * The time at which AWS WAF received the request from your AWS resource, in Unix time format (in seconds). * </p> * * @param timestamp * The time at which AWS WAF received the request from your AWS resource, in Unix time format (in seconds). * @return Returns a reference to this object so that method calls can be chained together. */ public SampledHTTPRequest withTimestamp(java.util.Date timestamp) { setTimestamp(timestamp); return this; }
/** * <p> * This value is returned if the <code>GetSampledRequests</code> request specifies the ID of a * <code>RuleGroup</code> rather than the ID of an individual rule. <code>RuleWithinRuleGroup</code> is the rule * within the specified <code>RuleGroup</code> that matched the request listed in the response. * </p> * * @param ruleWithinRuleGroup * This value is returned if the <code>GetSampledRequests</code> request specifies the ID of a * <code>RuleGroup</code> rather than the ID of an individual rule. <code>RuleWithinRuleGroup</code> is the * rule within the specified <code>RuleGroup</code> that matched the request listed in the response. * @return Returns a reference to this object so that method calls can be chained together. */ public SampledHTTPRequest withRuleWithinRuleGroup(String ruleWithinRuleGroup) { setRuleWithinRuleGroup(ruleWithinRuleGroup); return this; }
public SampledHTTPRequest unmarshall(JsonUnmarshallerContext context) throws Exception { SampledHTTPRequest sampledHTTPRequest = new SampledHTTPRequest(); if (context.testExpression("Request", targetDepth)) { context.nextToken(); sampledHTTPRequest.setRequest(HTTPRequestJsonUnmarshaller.getInstance().unmarshall(context)); sampledHTTPRequest.setWeight(context.getUnmarshaller(Long.class).unmarshall(context)); sampledHTTPRequest.setTimestamp(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context)); sampledHTTPRequest.setAction(context.getUnmarshaller(String.class).unmarshall(context)); sampledHTTPRequest.setRuleWithinRuleGroup(context.getUnmarshaller(String.class).unmarshall(context));
return false; SampledHTTPRequest other = (SampledHTTPRequest) obj; if (other.getRequest() == null ^ this.getRequest() == null) return false; if (other.getRequest() != null && other.getRequest().equals(this.getRequest()) == false) return false; if (other.getWeight() == null ^ this.getWeight() == null) return false; if (other.getWeight() != null && other.getWeight().equals(this.getWeight()) == false) return false; if (other.getTimestamp() == null ^ this.getTimestamp() == null) return false; if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false) return false; if (other.getAction() == null ^ this.getAction() == null) return false; if (other.getAction() != null && other.getAction().equals(this.getAction()) == false) return false; if (other.getRuleWithinRuleGroup() == null ^ this.getRuleWithinRuleGroup() == null) return false; if (other.getRuleWithinRuleGroup() != null && other.getRuleWithinRuleGroup().equals(this.getRuleWithinRuleGroup()) == 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 (getRequest() != null) sb.append("Request: ").append(getRequest()).append(","); if (getWeight() != null) sb.append("Weight: ").append(getWeight()).append(","); if (getTimestamp() != null) sb.append("Timestamp: ").append(getTimestamp()).append(","); if (getAction() != null) sb.append("Action: ").append(getAction()).append(","); if (getRuleWithinRuleGroup() != null) sb.append("RuleWithinRuleGroup: ").append(getRuleWithinRuleGroup()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(SampledHTTPRequest sampledHTTPRequest, ProtocolMarshaller protocolMarshaller) { if (sampledHTTPRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(sampledHTTPRequest.getRequest(), REQUEST_BINDING); protocolMarshaller.marshall(sampledHTTPRequest.getWeight(), WEIGHT_BINDING); protocolMarshaller.marshall(sampledHTTPRequest.getTimestamp(), TIMESTAMP_BINDING); protocolMarshaller.marshall(sampledHTTPRequest.getAction(), ACTION_BINDING); protocolMarshaller.marshall(sampledHTTPRequest.getRuleWithinRuleGroup(), RULEWITHINRULEGROUP_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
/** * Marshall the given parameter object. */ public void marshall(SampledHTTPRequest sampledHTTPRequest, ProtocolMarshaller protocolMarshaller) { if (sampledHTTPRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(sampledHTTPRequest.getRequest(), REQUEST_BINDING); protocolMarshaller.marshall(sampledHTTPRequest.getWeight(), WEIGHT_BINDING); protocolMarshaller.marshall(sampledHTTPRequest.getTimestamp(), TIMESTAMP_BINDING); protocolMarshaller.marshall(sampledHTTPRequest.getAction(), ACTION_BINDING); protocolMarshaller.marshall(sampledHTTPRequest.getRuleWithinRuleGroup(), RULEWITHINRULEGROUP_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }