google / google/auto

Immutable*Collection*.Builder methods can't begin with 'get'

Open
#387 3 comments 0 reactions 0 assignees View on GitHub
Component: value P3 type=documentation
Dominant language
Java
Stars
10.6k
Forks
1.2k
Avg merge
6h 32m
Merged PRs (30d)
13

Description

```
@AutoValue
abstract class MyClass {
abstract ImmutableList getBlobs();
Builder builder() {
return new AutoValue_MyClass.Builder();
}
@AutoValue.Builder
abstract static class Builder {
abstract ImmutableList.Builder getBlobsBuilder();
abstract MyClass build();
}
}
```

Results in:

```
Error: ... : Method without arguments should be a build method returning MyClass or a getter method with the same name and type as a getter method of MyClass
```

Currently, you must name `getBlobsBuilder()` as `blobsBuilder()` to function. As every other builder method supports _bean_ style setters, the collections builders should support _bean_ style getters.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.