Introduction to AutoValue | Baeldung
AutoValue is a source code generator for Java, and more specifically it's a library for generating source code for value objects or value-typed objects.
In order to generate a value-type object all you have to do is to annotate an abstract class with the @AutoValue annotation and compile your class. What is generated is a value object with accessor methods, parameterized constructor, properly overridden toString(), equals(Object) and hashCode() methods.
The following code snippet is a quick example of an abstract class that when compiled will result in a value object named AutoValue_Person.
Read full article from Introduction to AutoValue | Baeldung
No comments:
Post a Comment