com.eg.agent.android.instrumentation.okhttp3.RequestBuilderExtension Maven / Gradle / Ivy
The newest version!
/*
* Decompiled with CFR 0.137.
*
* Could not load the following classes:
* okhttp3.CacheControl
* okhttp3.Headers
* okhttp3.Request
* okhttp3.Request$Builder
* okhttp3.RequestBody
*/
package com.eg.agent.android.instrumentation.okhttp3;
import java.net.URL;
import com.eg.agent.android.EGAgent;
import okhttp3.CacheControl;
import okhttp3.Headers;
import okhttp3.Request;
import okhttp3.RequestBody;
public class RequestBuilderExtension
extends Request.Builder {
private Request.Builder impl;
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);
}
}
}