You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AutoValue strips JavaBeans prefixes (get-, is-) from constructor parameter names if the annotated class uses it consistently (see AutoValue HowTo). AutoParcel ignores this and uses the full property name in the generated constructor.
It would be nice if AutoParcel would use the same naming for it's constructor parameter names.
Sample
User.java
package com.example;
import android.os.Parcelable;
import com.google.auto.value.AutoValue;
@AutoValue
public abstract class User implements Parcelable {
public abstract String getId();
public abstract String getName();
}
$AutoValue_User.java (generated by AutoValue)
package com.example;
import javax.annotation.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
abstract class $AutoValue_User extends User {
private final String id;
private final String name;
$AutoValue_User(
String id,
String name) {
if (id == null) {
throw new NullPointerException("Null id");
}
this.id = id;
if (name == null) {
throw new NullPointerException("Null name");
}
this.name = name;
}
@Override
public String getId() {
return id;
}
@Override
public String getName() {
return name;
}
...
}
AutoValue_User.java (generated by AutoParcel)
package com.example;
import android.os.Parcel;
import android.os.Parcelable;
import java.lang.ClassLoader;
final class AutoValue_User extends $AutoValue_User {
private final static ClassLoader CL = AutoValue_User.class.getClassLoader();
public AutoValue_User (
java.lang.String getId,
java.lang.String getName
) {
super(
getId,
getName
);
}
...
}
The text was updated successfully, but these errors were encountered:
AutoValue strips JavaBeans prefixes (get-, is-) from constructor parameter names if the annotated class uses it consistently (see AutoValue HowTo). AutoParcel ignores this and uses the full property name in the generated constructor.
It would be nice if AutoParcel would use the same naming for it's constructor parameter names.
Sample
The text was updated successfully, but these errors were encountered: