@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getClientIP() == null) ? 0 : getClientIP().hashCode()); hashCode = prime * hashCode + ((getCountry() == null) ? 0 : getCountry().hashCode()); hashCode = prime * hashCode + ((getURI() == null) ? 0 : getURI().hashCode()); hashCode = prime * hashCode + ((getMethod() == null) ? 0 : getMethod().hashCode()); hashCode = prime * hashCode + ((getHTTPVersion() == null) ? 0 : getHTTPVersion().hashCode()); hashCode = prime * hashCode + ((getHeaders() == null) ? 0 : getHeaders().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 (getClientIP() != null) sb.append("ClientIP: ").append(getClientIP()).append(","); if (getCountry() != null) sb.append("Country: ").append(getCountry()).append(","); if (getURI() != null) sb.append("URI: ").append(getURI()).append(","); if (getMethod() != null) sb.append("Method: ").append(getMethod()).append(","); if (getHTTPVersion() != null) sb.append("HTTPVersion: ").append(getHTTPVersion()).append(","); if (getHeaders() != null) sb.append("Headers: ").append(getHeaders()); sb.append("}"); return sb.toString(); }
if (other.getHTTPVersion() != null && other.getHTTPVersion().equals(this.getHTTPVersion()) == false) return false; if (other.getHeaders() == null ^ this.getHeaders() == null) return false; if (other.getHeaders() != null && other.getHeaders().equals(this.getHeaders()) == false) return false; return true;
/** * Marshall the given parameter object. */ public void marshall(HTTPRequest hTTPRequest, ProtocolMarshaller protocolMarshaller) { if (hTTPRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(hTTPRequest.getClientIP(), CLIENTIP_BINDING); protocolMarshaller.marshall(hTTPRequest.getCountry(), COUNTRY_BINDING); protocolMarshaller.marshall(hTTPRequest.getURI(), URI_BINDING); protocolMarshaller.marshall(hTTPRequest.getMethod(), METHOD_BINDING); protocolMarshaller.marshall(hTTPRequest.getHTTPVersion(), HTTPVERSION_BINDING); protocolMarshaller.marshall(hTTPRequest.getHeaders(), HEADERS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
/** * Marshall the given parameter object. */ public void marshall(HTTPRequest hTTPRequest, ProtocolMarshaller protocolMarshaller) { if (hTTPRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(hTTPRequest.getClientIP(), CLIENTIP_BINDING); protocolMarshaller.marshall(hTTPRequest.getCountry(), COUNTRY_BINDING); protocolMarshaller.marshall(hTTPRequest.getURI(), URI_BINDING); protocolMarshaller.marshall(hTTPRequest.getMethod(), METHOD_BINDING); protocolMarshaller.marshall(hTTPRequest.getHTTPVersion(), HTTPVERSION_BINDING); protocolMarshaller.marshall(hTTPRequest.getHeaders(), HEADERS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }