com.eg.agent.android.instrumentation.okhttp2.RequestBuilderExtension Maven / Gradle / Ivy
The newest version!
/*
* Decompiled with CFR 0.137.
*
* Could not load the following classes:
* com.squareup.okhttp.CacheControl
* com.squareup.okhttp.Headers
* com.squareup.okhttp.Request
* com.squareup.okhttp.Request$Builder
* com.squareup.okhttp.RequestBody
*/
package com.eg.agent.android.instrumentation.okhttp2;
import com.eg.agent.android.instrumentation.httphelper.TransactionData;
import com.eg.agent.android.EGAgent;
import com.squareup.okhttp.CacheControl;
import com.squareup.okhttp.Headers;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import java.net.URL;
public class RequestBuilderExtension
extends Request.Builder {
private Request.Builder impl;
private TransactionData transactionState;
public RequestBuilderExtension(Request.Builder impl) {
this.impl = impl;
this.setCrossProcessHeader();
}
public Request.Builder url(String url) {
return this.impl.url(url);
}
public Request.Builder url(URL url) {
return this.impl.url(url);
}
public Request.Builder header(String name, String value) {
return this.impl.header(name, value);
}
public Request.Builder addHeader(String name, String value) {
return this.impl.addHeader(name, value);
}
public Request.Builder removeHeader(String name) {
return this.impl.removeHeader(name);
}
public Request.Builder headers(Headers headers) {
return this.impl.headers(headers);
}
public Request.Builder cacheControl(CacheControl cacheControl) {
return this.impl.cacheControl(cacheControl);
}
public Request.Builder get() {
return this.impl.get();
}
public Request.Builder head() {
return this.impl.head();
}
public Request.Builder post(RequestBody body) {
return this.impl.post(body);
}
public Request.Builder delete() {
return this.impl.delete();
}
public Request.Builder put(RequestBody body) {
return this.impl.put(body);
}
public Request.Builder patch(RequestBody body) {
return this.impl.patch(body);
}
public Request.Builder method(String method, RequestBody body) {
return this.impl.method(method, body);
}
public Request.Builder tag(Object tag) {
return this.impl.tag(tag);
}
public Request build() {
return this.impl.build();
}
private void setCrossProcessHeader() {
String crossProcessId = EGAgent.getCrossProcessId();
if (crossProcessId != null) {
this.impl.removeHeader("X-EG-ID");
this.impl.addHeader("X-EG-ID", crossProcessId);
}
}
}