Brief introduction of idea Lombok and solutions for reporting red and wrong

idea lombok
Introduction of lombok
Lombok is a Java library that automatically switches on editors and build tools. For simple Java objects, you can substitute getters and Setter methods in code with annotations such as @setter @getter. Lombok uses annotations, but instead of using reflection, it dynamically replaces annotations with concrete code at compile time. So the actual code that the JVM runs is the same as the classes that we write manually that contain the various tool methods.
Lombok annotations
Val: final declares a variable in fianl just like a dynamic language does. Var: with JDK10 @ Data: annotation on the class, will provide all of the attributes of the class to add the get and set methods, and add, equals, canEquals @ Setter, hashCode, and toString method: annotation on the class, add a set method for all attribute, comments on the property for the attribute set method @ Getter: annotation on the class, add the get method to all of the properties, comments on the attribute of the attribute provides the get method @ NotNull: When used in the parameter, if pass the null values when the call, will be thrown null pointer exception @ Synchronized to method, can lock the specified object, if not specified, the default to create an object locking @ the Log function in the class, create a Log properties @ Builder: using the Builder pattern to create objects @ NoArgsConstructor: create a a no-parameter constructor @ AllArgsConstructor: create a full constructor @ ToString refs: Create a ToString method @accessors (chain = true) that uses the chain setting property. The set method returns this object. @RequiredArgConstructor (StaticName = “of”) creates and generates a static method @UtilityClass: Utility class @ExtensionMethod: Sets parent class @FieldDefaults: Sets the scope of properties, such as private, public, etc., and can also set whether properties are final modified. @cleanup: Close streams, join points. @equalSandHashCode: Overrides the equals and hashCode methods. @toString: Create the toString method. @cleanup: Can be used for streams etc without needing to close the use of stream objects.
Lombok error resolution:
1. Use compiler to select javac
2. Enable Annotation Processing

. After installation, restart IDEA. Gives effect to the plugin
4. Maven versions do not agree with the idea lombok version


4. Idea2018 version
IntelliJ idea 2018.1.5 \ plugins \ android \ lib \ templates \ gradle \ wrapper \ gradle \ wrapper
idea under the install directory
ideaVersion=2018.1
start idea then manually install Lombok plugins and restart again


Read More: