Initial commit

This commit is contained in:
2025-05-13 19:24:51 +02:00
commit a950f49678
10604 changed files with 932663 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package com.thoughtworks.xstream.converters.time;
import com.thoughtworks.xstream.converters.ConversionException;
import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter;
import java.time.Year;
/* loaded from: classes.dex */
public class YearConverter extends AbstractSingleValueConverter {
@Override // com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter, com.thoughtworks.xstream.converters.ConverterMatcher
public boolean canConvert(Class cls) {
return Year.class == cls;
}
@Override // com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter, com.thoughtworks.xstream.converters.SingleValueConverter
public Year fromString(String str) {
try {
return Year.of(Integer.parseInt(str));
} catch (NumberFormatException e) {
ConversionException conversionException = new ConversionException("Cannot parse value as year", e);
conversionException.add("value", str);
throw conversionException;
}
}
}