Immutables stars

Java annotation processors to generate simple, safe and consistent value objects. Do not repeat yourself, try Immutables, the most comprehensive tool in this field!

Get started! Read guide... v2.5.5 News and announcements
import org.immutables.value.Value;
// Define abstract value type
public interface ValueObject {
  String name();
  List<Integer> counts();
  Optional<String> description();
// Use generated immutable implementation
ValueObject valueObject =
        .name("My value")
// Or you can configure different @Value.Style
abstract class AbstractItem {
  abstract String getName();
  abstract Set<String> getTags();
  abstract Optional<String> getDescription();
// Use generated value object
Item namelessItem = Item.builder()
    .addTags("important", "relevant")
    .setDescription("Description provided")

Item namedValue = namelessItem.withName("Named");

Values and Builders

With Immutables you can generate state of the art immutable objects and builders. Type-safe, null-safe and thread-safe, with no boilerplate. Generate builders for immutable objects and even plain static factory methods.

Easy to use

Just add jar to classpath and use. No required runtime dependencies! Guava is supported, but not required. Works out-of-the box with build tools, integrates into IDEs. Get started!

Feature packed

Lazy, derived and optional attributes. Comprehensive support for collections as attributes, including Guava collections. Generic parameters. Copy with structural sharing. Singleton and interned instances... and more!

Clean code

Immutables has much higher standards for code readability than other generators. Generated APIs are carefully tuned for the best power-to-weight ratio. No ugly named identifiers. Implementation code is clear, efficient, and have corresponding javadocs. Take a look



Adapt Immutables to your code conventions and tastes. Customize get, set, with or whatever prefixes. Describe styles as reusable meta-annotations. Generate as much or as little as you need, expose or hide generated classes. Go rogue with Encodings to implement custom attribute types!


Immutables are serialization ready, including JSON and its binary forms. Jackson and Gson libraries are supported. Gson is integrated using generated TypeAdapters which use no reflection. JSON guide. MongoDB repositories also included.

Classes, Interfaces and Annotations Builders Constuctor methods With-copy methods equals, toString, hashCode methods Default attributes Derived attributes Lazy attributes Optional attributes Array, List, Set and Map attributes Singleton values Instance interning hashCode precomputing JSON serialization JAX-RS integration MongoDB integration