Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Java
  3. Record-Builder

Record-Builder

Apache-2.0Javarecord-builder-52

An annotation processor that generates builders, withers, and records for Java records and interfaces.

GitHubGitHub
921 stars69 forks0 contributors

What is Record-Builder?

RecordBuilder is a Java annotation processor that generates builder classes and 'wither' copy methods for Java records. It solves the problem of Java records lacking convenient construction and modification patterns, providing a fluent API for creating and transforming immutable data objects. The tool can also generate complete records from interface definitions, making it easier to define data contracts.

Target Audience

Java developers using Java 16+ records who need more flexible construction patterns, immutable updates, or want to generate records from interfaces. It's particularly useful for projects emphasizing immutable data models and clean API design.

Value Proposition

Developers choose RecordBuilder because it seamlessly integrates with Java's standard record feature, requires no runtime dependencies, and offers extensive customization. It provides a lightweight, annotation-driven solution to overcome the limitations of vanilla records, making immutable data handling more practical and expressive.

Overview

Record builder generator for Java records

Use Cases

Best For

  • Adding fluent builders to Java records for step-by-step object construction
  • Implementing immutable updates via 'wither' methods in record-based models
  • Generating records and their builders from interface definitions
  • Enhancing library or third-party records with builders without modifying source code
  • Creating deconstructor-based records from existing class structures
  • Customizing record builder generation with project-specific patterns or collections

Not Ideal For

  • Projects not using Java 16+ or records at all, as it's specifically designed for that feature set
  • Teams prioritizing zero-configuration tools, since it requires annotation processor setup in build tools and IDEs
  • Applications where minimizing generated code is critical, as it adds companion classes for every record

Pros & Cons

Pros

Fluent Builder Generation

Automatically creates a fluent builder class for any Java record, enabling step-by-step construction as shown in the RecordBuilder Example with methods like `.name(aName).age(anAge).build()`.

Immutable Wither Methods

Adds `withX()` copy methods for immutable updates, either by implementing a generated interface or via static helpers, as demonstrated in the Wither Example with `r1.withName("bar")`.

Interface-to-Record Generation

Generates full records from interface definitions, including builders and withers, useful for defining data contracts without boilerplate, as in the RecordInterface Example.

External Code Support

Can generate builders for existing records and interfaces from unmodifiable source code using `@Include` annotations, allowing enhancement of library classes without modification.

Cons

Annotation Processor Setup

Requires explicit configuration in Maven, Gradle, and IDE settings for annotation processing, which can be complex and prone to environment-specific issues, as detailed in the Usage section.

Documentation Fragmentation

Key features and customization options are split across multiple markdown files (customizing.md, options.md, deconstructors.md), making it harder to find comprehensive information in one place.

IDE Dependence

Successful use depends on proper IDE configuration for annotation processing, which might not work out-of-the-box in all environments, potentially causing frustration during setup.

Frequently Asked Questions

Quick Stats

Stars921
Forks69
Contributors0
Open Issues26
Last commit2 months ago
CreatedSince 2019

Tags

#gradle#annotation-processor#java#immutable-data#builder-pattern#code-generation#maven

Built With

M
Maven
J
Java
G
Gradle

Included in

Java47.5k
Auto-fetched 5 hours ago

Related Projects

JHipsterJHipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.

Stars22,406
Forks4,174
Last commit11 hours ago
JavaPoetJavaPoet

A Java API for generating .java source files.

Stars10,853
Forks1,387
Last commit1 year ago
autoauto

A collection of source code generators for Java.

Stars10,554
Forks1,213
Last commit1 day ago
FreeBuilderFreeBuilder

Automatic generation of the Builder pattern for Java

Stars834
Forks102
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub