40 lines
1.3 KiB
Java
40 lines
1.3 KiB
Java
|
package io.grpc;
|
||
|
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.Arrays;
|
||
|
import java.util.Collections;
|
||
|
import java.util.Iterator;
|
||
|
import java.util.List;
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
public final class ChoiceChannelCredentials extends ChannelCredentials {
|
||
|
private final List<ChannelCredentials> creds;
|
||
|
|
||
|
public static ChannelCredentials create(ChannelCredentials... channelCredentialsArr) {
|
||
|
if (channelCredentialsArr.length == 0) {
|
||
|
throw new IllegalArgumentException("At least one credential is required");
|
||
|
}
|
||
|
for (ChannelCredentials channelCredentials : channelCredentialsArr) {
|
||
|
}
|
||
|
return new ChoiceChannelCredentials(Collections.unmodifiableList(new ArrayList(Arrays.asList(channelCredentialsArr))));
|
||
|
}
|
||
|
|
||
|
private ChoiceChannelCredentials(List<ChannelCredentials> list) {
|
||
|
this.creds = list;
|
||
|
}
|
||
|
|
||
|
@Override // io.grpc.ChannelCredentials
|
||
|
public final ChannelCredentials withoutBearerTokens() {
|
||
|
ArrayList arrayList = new ArrayList();
|
||
|
Iterator<ChannelCredentials> it = this.creds.iterator();
|
||
|
while (it.hasNext()) {
|
||
|
arrayList.add(it.next().withoutBearerTokens());
|
||
|
}
|
||
|
return new ChoiceChannelCredentials(Collections.unmodifiableList(arrayList));
|
||
|
}
|
||
|
|
||
|
public final List<ChannelCredentials> getCredentialsList() {
|
||
|
return this.creds;
|
||
|
}
|
||
|
}
|