135 lines
4.7 KiB
Java
135 lines
4.7 KiB
Java
|
package retrofit2.converter.scalars;
|
||
|
|
||
|
import java.io.IOException;
|
||
|
import okhttp3.ResponseBody;
|
||
|
import retrofit2.Converter;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
final class ScalarResponseBodyConverters {
|
||
|
private ScalarResponseBodyConverters() {
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
static final class StringResponseBodyConverter implements Converter<ResponseBody, String> {
|
||
|
static final StringResponseBodyConverter INSTANCE = new StringResponseBodyConverter();
|
||
|
|
||
|
StringResponseBodyConverter() {
|
||
|
}
|
||
|
|
||
|
@Override // retrofit2.Converter
|
||
|
public final String convert(ResponseBody responseBody) throws IOException {
|
||
|
return responseBody.string();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
static final class BooleanResponseBodyConverter implements Converter<ResponseBody, Boolean> {
|
||
|
static final BooleanResponseBodyConverter INSTANCE = new BooleanResponseBodyConverter();
|
||
|
|
||
|
BooleanResponseBodyConverter() {
|
||
|
}
|
||
|
|
||
|
@Override // retrofit2.Converter
|
||
|
public final Boolean convert(ResponseBody responseBody) throws IOException {
|
||
|
return Boolean.valueOf(responseBody.string());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
static final class ByteResponseBodyConverter implements Converter<ResponseBody, Byte> {
|
||
|
static final ByteResponseBodyConverter INSTANCE = new ByteResponseBodyConverter();
|
||
|
|
||
|
ByteResponseBodyConverter() {
|
||
|
}
|
||
|
|
||
|
@Override // retrofit2.Converter
|
||
|
public final Byte convert(ResponseBody responseBody) throws IOException {
|
||
|
return Byte.valueOf(responseBody.string());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
static final class CharacterResponseBodyConverter implements Converter<ResponseBody, Character> {
|
||
|
static final CharacterResponseBodyConverter INSTANCE = new CharacterResponseBodyConverter();
|
||
|
|
||
|
CharacterResponseBodyConverter() {
|
||
|
}
|
||
|
|
||
|
@Override // retrofit2.Converter
|
||
|
public final Character convert(ResponseBody responseBody) throws IOException {
|
||
|
String string = responseBody.string();
|
||
|
if (string.length() != 1) {
|
||
|
StringBuilder sb = new StringBuilder("Expected body of length 1 for Character conversion but was ");
|
||
|
sb.append(string.length());
|
||
|
throw new IOException(sb.toString());
|
||
|
}
|
||
|
return Character.valueOf(string.charAt(0));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
static final class DoubleResponseBodyConverter implements Converter<ResponseBody, Double> {
|
||
|
static final DoubleResponseBodyConverter INSTANCE = new DoubleResponseBodyConverter();
|
||
|
|
||
|
DoubleResponseBodyConverter() {
|
||
|
}
|
||
|
|
||
|
@Override // retrofit2.Converter
|
||
|
public final Double convert(ResponseBody responseBody) throws IOException {
|
||
|
return Double.valueOf(responseBody.string());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
static final class FloatResponseBodyConverter implements Converter<ResponseBody, Float> {
|
||
|
static final FloatResponseBodyConverter INSTANCE = new FloatResponseBodyConverter();
|
||
|
|
||
|
FloatResponseBodyConverter() {
|
||
|
}
|
||
|
|
||
|
@Override // retrofit2.Converter
|
||
|
public final Float convert(ResponseBody responseBody) throws IOException {
|
||
|
return Float.valueOf(responseBody.string());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
static final class IntegerResponseBodyConverter implements Converter<ResponseBody, Integer> {
|
||
|
static final IntegerResponseBodyConverter INSTANCE = new IntegerResponseBodyConverter();
|
||
|
|
||
|
IntegerResponseBodyConverter() {
|
||
|
}
|
||
|
|
||
|
@Override // retrofit2.Converter
|
||
|
public final Integer convert(ResponseBody responseBody) throws IOException {
|
||
|
return Integer.valueOf(responseBody.string());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
static final class LongResponseBodyConverter implements Converter<ResponseBody, Long> {
|
||
|
static final LongResponseBodyConverter INSTANCE = new LongResponseBodyConverter();
|
||
|
|
||
|
LongResponseBodyConverter() {
|
||
|
}
|
||
|
|
||
|
@Override // retrofit2.Converter
|
||
|
public final Long convert(ResponseBody responseBody) throws IOException {
|
||
|
return Long.valueOf(responseBody.string());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
static final class ShortResponseBodyConverter implements Converter<ResponseBody, Short> {
|
||
|
static final ShortResponseBodyConverter INSTANCE = new ShortResponseBodyConverter();
|
||
|
|
||
|
ShortResponseBodyConverter() {
|
||
|
}
|
||
|
|
||
|
@Override // retrofit2.Converter
|
||
|
public final Short convert(ResponseBody responseBody) throws IOException {
|
||
|
return Short.valueOf(responseBody.string());
|
||
|
}
|
||
|
}
|
||
|
}
|