javaspring-bootlombok

How to use Lombok dependency in springboot?


@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class OrderResponse {

 private String name;
 private String productName;
}
  1. when we use lombok annotations how does the data binding happen in runtime?

Solution

  • Based on https://projectlombok.org/features/Data, Data contains @ToString, @EqualsAndHashCode, @Getter, @Setter, @RequiredArgsConstructor

    The use in spring is no different than elsewhere, you can also set up items that contain lombok at https://start.spring.io/