mirror of
https://github.com/fankes/moshi.git
synced 2025-10-18 23:49:21 +08:00
Convert util package to Kotlin (#1461)
* Rename .java to .kt * Convert NonNullJsonAdapter * Rename .java to .kt * Convert NullSafeJsonAdapter * Fix missing null-check * Rename .java to .kt * Convert Util (initial pass) * Push to top-level Util * Use extensions and properties where possible * Use knownNotNull * Spotless * Clean up impl type classes a bit * Update code gen * Use extension for resolving * Spotless * Fix master conflicts * Rename to toStringWithAnnotations() * for (t in args.indices) { * for (i in interfaces.indices) { * Template
This commit is contained in:
@@ -68,7 +68,7 @@ public final class EnumJsonAdapter<T extends Enum<T>> extends JsonAdapter<T> {
|
||||
nameStrings = new String[constants.length];
|
||||
for (int i = 0; i < constants.length; i++) {
|
||||
String constantName = constants[i].name();
|
||||
nameStrings[i] = jsonName(constantName, enumType.getField(constantName));
|
||||
nameStrings[i] = jsonName(enumType.getField(constantName), constantName);
|
||||
}
|
||||
options = JsonReader.Options.of(nameStrings);
|
||||
} catch (NoSuchFieldException e) {
|
||||
|
Reference in New Issue
Block a user