what-the-bank/sources/com/huawei/hms/support/api/client/ResultConvert.java

32 lines
1.1 KiB
Java

package com.huawei.hms.support.api.client;
import com.huawei.hms.common.internal.Preconditions;
import com.huawei.hms.support.api.client.Result;
/* loaded from: classes2.dex */
public abstract class ResultConvert<R extends Result, S extends Result> {
/* loaded from: classes2.dex */
public class FailPendingResult extends EmptyPendingResult {
final ResultConvert this$0;
public FailPendingResult(ResultConvert resultConvert, Status status) {
this.this$0 = resultConvert;
setResult(status);
}
}
public final PendingResult newFailedPendingResult(Status status) {
Preconditions.checkNotNull(status, "The input status cannot be null");
Preconditions.checkArgument(!status.isSuccess(), "The input status must be call with success status");
return new FailPendingResult(this, status);
}
public Status onFailed(Status status) {
Preconditions.checkNotNull(status, "The input status cannot be null");
return status.getStatusCode() != 0 ? status : Status.CoreException;
}
public abstract PendingResult onSuccess(Result result);
}