org.immutables:serial

2.11.0-beta2last stable release 3 weeks ago
Complexity Score
High
Open Issues
443
Dependent Projects
7

License

  • Apache-2.0
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Yespatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Readme

Read full documentation at http://immutables.org

Modern usage style, aka “sandwich”

// Define abstract value type using interface, abstract class or annotation
@Value.Immutable
public interface ValueObject extends WithValueObject {
  // WithValueObject is not yet generated, We extend With* to inherit `with*` method signatures
  String name();
  List<Integer> counts();
  Optional<String> description();

  class Builder extends ImmutableValueObject.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 builder
ValueObject v =
    new ValueObject.Builder()
        .name("Nameless")
        .description("present")
        .addCounts(1)
        .addCounts(2)
        .build();

v = v.withName("Doe");

//fetch values via accessors
List<Integer> counts = v.counts();
Optional<String> description = v.description();

ImmutableValueObject then would not be used outside generated type. See about this and other generation styles here

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

Dependencies

No runtime dependency information found for this package.

CVE IssuesActive
0
Scorecards Score
4.50
Test Coverage
No Data
Follows Semver
No
Github Stars
3,474
Dependenciestotal
5
DependenciesOutdated
0
DependenciesDeprecated
0
Threat Modelling
No
Repo Audits
No

Learn how to distribute org.immutables:serial in your own private Maven registry

mvn install org.immutables:serial
Processing...
Done

122 Releases