Closed bobroalexandr closed 8 years ago
Because there is no default value declared.
All backing fields you declare are NonNull by default. So you have to declare all fields.
If you really want null you can declare all fields nullable, like you wrote.
Or to have some pre initialization you can add a static factory method to prepare the builder with all values you like.
And why don't use Java default values for primitive types? How can I set default values for primitives?
AutoParcel now uses the AutoValue extension apis. Please refer to https://github.com/google/auto/tree/master/value for implementation and potential issues
new IllegalStateException("Missing required properties:" + missing is thrown if I don't call all Builder methods. Why do you have such behavior there? Sometimes developer may need to call : AutoParcel_SomeObject.Builder().build(); and now IllegalStateException will be thrown in this case.
Seems like @Nullable annotation solves that problem but that a bad practice to use that annotation near primitive types.