Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
I

immutables

> 编程语言
Open source

Java annotation processor to create immutable objects and builders, for records too. Sweep boilerplate code under the rug!

3.6K stars0 likes0 views
WebsiteGitHub

About

Java annotation processor to create immutable objects and builders, for records too. Sweep boilerplate code under the rug!

Full documentation at immutables.org

Record Builder

@Value.Builder
record Person(String name, int age, String email) {}

// Use the generated builder
Person person = new PersonBuilder()
    .name("Alice")
    .age(30)
    .email("[email protected]")
    .build();

More fancy example having copy-with methods generated, and style withUnaryOperator="with*"

@Value.Builder
record Person(String name, int age) implements WithPerson {
  // Extend the generated PersonBuilder
  static class Builder extends PersonBuilder {}
}

// Use your custom builder
var person = new Person.Builder()
    .name("Bob")
    .age(18)
    .build();

person = person.withName("Bobby!")
    .withAge(age -> age + 3);

Immutable class

Minimal, classical style

@Value.Immutable
interface Book {
  String isbn();
  String title();
  List<String> authors();
}

ImmutableBook book = ImmutableBook.builder()
    .isbn("978-1-56619-909-4")
    .title("The Elements of Style")
    .addAuthors("William Strunk Jr.", "E.B. White.")
    .build();

"sandwich" style, with nested builder and extending With* interface

…

Changelog

See releases tab for release history. Archived changelog for earlier releases.

GitHub Issues· 459 open

View all on GitHub
  • #1680

    In-memory backend compares values by representation, so a stored 2.00 does not match a queried 2

    Updated Sep 11, 2026
  • #1678

    In-memory backend throws NullPointerException when ordering by a nullable attribute

    Updated Sep 11, 2026
  • #1194

    Builder from uses Guava immutables internally and can cause IllegalArgumentException

    Updated Aug 28, 2026
  • #1652

    Encoding.Copy not copy annotation of methods

    Updated Aug 19, 2026
  • #964

    Compilation error when attributeBuilderDetection is used with overshadowImplementation

    bugUpdated Jul 29, 2026
  • #1667

    TYPE_USE annotations used for wildcard bounds are not retained

    Updated Jul 2, 2026
  • #1649

    Jackson 3 annotations ignored when used as meta-annotations on package-info or parent interfaces

    Updated Jun 17, 2026
  • #1666

    Skip invariant checks for items that are interned

    Updated Jun 3, 2026
  • #1663

    Unexpected behaviour for Derived field depending on Default Optional fields

    bugcompletedUpdated May 22, 2026

Highlights

  • •Java
  • •annotation-processor
  • •builder
  • •gson
  • •guava

> Tags

Javaannotation-processorbuildergsonguava

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言