Skip to content

Releases: inferred/FreeBuilder

v1.14

28 Feb 23:19
Compare
Choose a tag to compare

This release adds support for SortedSet properties.

interface RecordShop {
  SortedSet<Record> records();

  class Builder extends RecordShop_Builder() {
    public Builder() {
      // Sorted sets default to natural ordering. If this isn't correct,
      // you can replace the comparator before adding values.
      setComparatorForRecords((a, b) -> a.name().compareTo(b.name()));
    }
  }
}

v1.13.3

06 Feb 13:32
Compare
Choose a tag to compare

This release fixes mishandling of NaN defaults in the mergeFrom methods (#240).

v1.13.2

06 Feb 12:33
Compare
Choose a tag to compare

Accidental duplicate registration of the FreeBuilder annotation processor will no longer result in warnings about files already existing; instead, only one processor will execute (#21).

v1.13.1

05 Feb 22:34
Compare
Choose a tag to compare

As of this release, FreeBuilder no longer erroneously declares dependencies to be pulled in at compile time. (We shade all our dependencies to avoid unnecessary version conflicts with other libraries.)

v1.13

04 Feb 16:31
Compare
Choose a tag to compare

Declare an abstract toBuilder() method, and FreeBuilder will now implement it. Unlike Builder.from(x), this supports modify-rebuild on partials, allowing users to write robust tests of transform code, which would previously throw UnsupportedOperationExceptions if given a partial.

Person partialJoe = new Person.Builder().name("Joe").buildPartial();
Person.Builder.from(partialJoe); // This will throw an UnsupportedOperationException
partialJoe.toBuilder().name("Bob").build(); // This will return another partial

Additionally, this release fixes a bug triggered when attempting to use a Multiset in a GWT-compatible value type (#231).

v1.12.3

18 Jan 12:23
Compare
Choose a tag to compare

v1.12.2

09 Jan 12:21
Compare
Choose a tag to compare

This release fixes a regression introduced in v1.10.6 which generated uncompilable code for generic value types containing a collection of parameters (e.g. List<E> where E is a parameter of the value type; see #229), as well as a long-standing bug in the same circumstances triggered only when Guava is not available (#178).

v1.12.1

06 Jan 14:16
Compare
Choose a tag to compare

This release fixes a regression introduced in v1.10.6 which generated uncompilable code for properties of type Collection, and wildcard properties of type List or Set (#227).

v1.12

12 Dec 17:27
Compare
Choose a tag to compare

Generated addAllX methods are now overridden to accept Streams and Spliterators on Java 8.

v1.11

06 Dec 17:45
Compare
Choose a tag to compare

FreeBuilder no longer requires a 'get' prefix on all getter methods, and will drop the 'set' prefix on its setters to follow suit. Existing FreeBuilder types will be unaffected.

@FreeBuilder
public interface Person {
  String name();
  int age();
  class Builder extends Person_Builder { }
}

Person bob = new Person.Builder().name("Bob").age(25).build();