- Notifications
You must be signed in to change notification settings - Fork289
Java annotation processor to create immutable objects and builders. Sweeps boilerplate code under the rug since 2013!
License
NotificationsYou must be signed in to change notification settings
immutables/immutables
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Read full documentation athttp://immutables.org
// Define abstract value type using interface, abstract class or annotation@Value.ImmutablepublicinterfaceValueObjectextendsWithValueObject {// WithValueObject is not yet generated, We extend With* to inherit `with*` method signaturesStringname();List<Integer>counts();Optional<String>description();classBuilderextendsImmutableValueObject.Builder {}// ImmutableValueObject.Builder will be generated and// our builder will inherit and reexport methods as its own.// Static nested Builder will inherit all the public method// signatures of ImmutableValueObject.Builder}// Use generated immutable implementation and builderValueObjectv =newValueObject.Builder() .name("Nameless") .description("present") .addCounts(1) .addCounts(2) .build();v =v.withName("Doe");//fetch values via accessorsList<Integer>counts =v.counts();Optional<String>description =v.description();
ImmutableValueObject then would not be used outside generated type. See about this and other generationstyles here
Seereleases tab for release history. Archivedchangelog for earlier releases.
About
Java annotation processor to create immutable objects and builders. Sweeps boilerplate code under the rug since 2013!
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.