All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.drjekyll.sentry.apachehttpclient4.RequestHash Maven / Gradle / Ivy

There is a newer version: 7.0.3
Show newest version
package org.drjekyll.sentry.apachehttpclient4;

import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.util.Args;

final class RequestHash {

  static final String SPAN_DATA_KEY = "request.hash";

  private RequestHash() {
    // utility
  }

  static int create(HttpUriRequest httpUriRequest) {
    Args.notNull(httpUriRequest, "HTTP request");
    int uriHash = httpUriRequest.getURI() != null ? httpUriRequest.getURI().hashCode() : 0;
    return 31 * uriHash + (httpUriRequest.getMethod() != null ? httpUriRequest.getMethod().hashCode() : 0);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy