导航菜单

页面标题

页面副标题

SpeedCash v6.5.1482 - CallOptions.java 源代码

正在查看: SpeedCash v6.5.1482 应用的 CallOptions.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package io.grpc;

import com.facebook.gamingservices.cloudgaming.internal.SDKConstants;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import io.grpc.ClientStreamTracer;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import javax.annotation.CheckReturnValue;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;

@CheckReturnValue
@Immutable
public final class CallOptions {
    public static final CallOptions DEFAULT;

    @Nullable
    public final Deadline a;

    @Nullable
    public final Executor b;

    @Nullable
    public final String c;

    @Nullable
    public final CallCredentials d;

    @Nullable
    public final String e;
    public final Object[][] f;
    public final List<ClientStreamTracer.Factory> g;

    @Nullable
    public final Boolean h;

    @Nullable
    public final Integer i;

    @Nullable
    public final Integer j;

    public static final class Key<T> {
        public final String a;
        public final T b;

        public Key(String str, T t) {
            this.a = str;
            this.b = t;
        }

        public static <T> Key<T> create(String str) {
            Preconditions.checkNotNull(str, "debugString");
            return new Key<>(str, null);
        }

        public static <T> Key<T> createWithDefault(String str, T t) {
            Preconditions.checkNotNull(str, "debugString");
            return new Key<>(str, t);
        }

        @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1869")
        @Deprecated
        public static <T> Key<T> of(String str, T t) {
            Preconditions.checkNotNull(str, "debugString");
            return new Key<>(str, t);
        }

        public T getDefault() {
            return this.b;
        }

        public String toString() {
            return this.a;
        }
    }

    public static class b {
        public Deadline a;
        public Executor b;
        public String c;
        public CallCredentials d;
        public String e;
        public Object[][] f;
        public List<ClientStreamTracer.Factory> g;
        public Boolean h;
        public Integer i;
        public Integer j;

        public final CallOptions b() {
            return new CallOptions(this);
        }
    }

    static {
        b bVar = new b();
        bVar.f = (Object[][]) Array.newInstance((Class<?>) Object.class, 0, 2);
        bVar.g = Collections.emptyList();
        DEFAULT = bVar.b();
    }

    public static b b(CallOptions callOptions) {
        b bVar = new b();
        bVar.a = callOptions.a;
        bVar.b = callOptions.b;
        bVar.c = callOptions.c;
        bVar.d = callOptions.d;
        bVar.e = callOptions.e;
        bVar.f = callOptions.f;
        bVar.g = callOptions.g;
        bVar.h = callOptions.h;
        bVar.i = callOptions.i;
        bVar.j = callOptions.j;
        return bVar;
    }

    public Boolean a() {
        return this.h;
    }

    @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1767")
    @Nullable
    public String getAuthority() {
        return this.c;
    }

    @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704")
    @Nullable
    public String getCompressor() {
        return this.e;
    }

    @Nullable
    public CallCredentials getCredentials() {
        return this.d;
    }

    @Nullable
    public Deadline getDeadline() {
        return this.a;
    }

    @Nullable
    public Executor getExecutor() {
        return this.b;
    }

    @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563")
    @Nullable
    public Integer getMaxInboundMessageSize() {
        return this.i;
    }

    @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563")
    @Nullable
    public Integer getMaxOutboundMessageSize() {
        return this.j;
    }

    @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1869")
    public <T> T getOption(Key<T> key) {
        Preconditions.checkNotNull(key, SDKConstants.PARAM_KEY);
        int i = 0;
        while (true) {
            Object[][] objArr = this.f;
            if (i >= objArr.length) {
                return (T) key.b;
            }
            if (key.equals(objArr[i][0])) {
                return (T) this.f[i][1];
            }
            i++;
        }
    }

    @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2861")
    public List<ClientStreamTracer.Factory> getStreamTracerFactories() {
        return this.g;
    }

    public boolean isWaitForReady() {
        return Boolean.TRUE.equals(this.h);
    }

    public String toString() {
        MoreObjects.ToStringHelper add = MoreObjects.toStringHelper(this).add("deadline", this.a).add("authority", this.c).add("callCredentials", this.d);
        Executor executor = this.b;
        return add.add("executor", executor != null ? executor.getClass() : null).add("compressorName", this.e).add("customOptions", Arrays.deepToString(this.f)).add("waitForReady", isWaitForReady()).add("maxInboundMessageSize", this.i).add("maxOutboundMessageSize", this.j).add("streamTracerFactories", this.g).toString();
    }

    @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1767")
    public CallOptions withAuthority(@Nullable String str) {
        b b2 = b(this);
        b2.c = str;
        return b2.b();
    }

    public CallOptions withCallCredentials(@Nullable CallCredentials callCredentials) {
        b b2 = b(this);
        b2.d = callCredentials;
        return b2.b();
    }

    @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704")
    public CallOptions withCompression(@Nullable String str) {
        b b2 = b(this);
        b2.e = str;
        return b2.b();
    }

    public CallOptions withDeadline(@Nullable Deadline deadline) {
        b b2 = b(this);
        b2.a = deadline;
        return b2.b();
    }

    public CallOptions withDeadlineAfter(long j, TimeUnit timeUnit) {
        return withDeadline(Deadline.after(j, timeUnit));
    }

    public CallOptions withExecutor(@Nullable Executor executor) {
        b b2 = b(this);
        b2.b = executor;
        return b2.b();
    }

    @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563")
    public CallOptions withMaxInboundMessageSize(int i) {
        Preconditions.checkArgument(i >= 0, "invalid maxsize %s", i);
        b b2 = b(this);
        b2.i = Integer.valueOf(i);
        return b2.b();
    }

    @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563")
    public CallOptions withMaxOutboundMessageSize(int i) {
        Preconditions.checkArgument(i >= 0, "invalid maxsize %s", i);
        b b2 = b(this);
        b2.j = Integer.valueOf(i);
        return b2.b();
    }

    public <T> CallOptions withOption(Key<T> key, T t) {
        Preconditions.checkNotNull(key, SDKConstants.PARAM_KEY);
        Preconditions.checkNotNull(t, "value");
        b b2 = b(this);
        int i = 0;
        while (true) {
            Object[][] objArr = this.f;
            if (i >= objArr.length) {
                i = -1;
                break;
            }
            if (key.equals(objArr[i][0])) {
                break;
            }
            i++;
        }
        Object[][] objArr2 = (Object[][]) Array.newInstance((Class<?>) Object.class, this.f.length + (i == -1 ? 1 : 0), 2);
        b2.f = objArr2;
        Object[][] objArr3 = this.f;
        System.arraycopy(objArr3, 0, objArr2, 0, objArr3.length);
        if (i == -1) {
            b2.f[this.f.length] = new Object[]{key, t};
        } else {
            b2.f[i] = new Object[]{key, t};
        }
        return b2.b();
    }

    @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2861")
    public CallOptions withStreamTracerFactory(ClientStreamTracer.Factory factory) {
        ArrayList arrayList = new ArrayList(this.g.size() + 1);
        arrayList.addAll(this.g);
        arrayList.add(factory);
        b b2 = b(this);
        b2.g = Collections.unmodifiableList(arrayList);
        return b2.b();
    }

    public CallOptions withWaitForReady() {
        b b2 = b(this);
        b2.h = Boolean.TRUE;
        return b2.b();
    }

    public CallOptions withoutWaitForReady() {
        b b2 = b(this);
        b2.h = Boolean.FALSE;
        return b2.b();
    }

    public CallOptions(b bVar) {
        this.a = bVar.a;
        this.b = bVar.b;
        this.c = bVar.c;
        this.d = bVar.d;
        this.e = bVar.e;
        this.f = bVar.f;
        this.g = bVar.g;
        this.h = bVar.h;
        this.i = bVar.i;
        this.j = bVar.j;
    }
}