일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 인프라
- spring integration
- 유닉스
- 웹 크롤링
- jpa
- 코틀린
- write by GPT-4
- 역학
- android
- chatGPT's answer
- 파이썬
- 자바암호
- JVM
- oracle
- GPT-4's answer
- write by chatGPT
- python
- Database
- 자바
- Java
- kotlin
- 시스템
- spring data jpa
- 리눅스
- 데이터베이스
- 고전역학
- 자바네트워크
- NIO
- 소프트웨어공학
- flet
- Today
- Total
목록lombok (9)
기억을 지배하는 기록
Immutable 'setters' - methods that create a clone but with one changed field. @Wither was introduced as experimental feature in lombok v0.11.4. @Wither was renamed to @With, and moved out of experimental and into the core package, in lombok v1.18.10. Overview The next best alternative to a setter for an immutable property is to construct a clone of the object, but with a new value for this one f..
synchronized done right: Don't expose your locks. Overview @Synchronized is a safer variant of the synchronized method modifier. Like synchronized, the annotation can be used on static and instance methods only. It operates similarly to the synchronized keyword, but it locks on different objects. The keyword locks on this, but the annotation locks on a field named $lock, which is private. If the..
Constructors made to order: Generates constructors that take no arguments, one argument per final / non-null field, or one argument for every field. Overview This set of 3 annotations generate a constructor that will accept 1 parameter for certain fields, and simply assigns this parameter to the field. @NoArgsConstructor will generate a constructor with no parameters. If this is not possible (be..
Equality made easy: Generates hashCode and equals implementations from the fields of your object. Overview Any class definition may be annotated with @EqualsAndHashCode to let lombok generate implementations of the equals(Object other) and hashCode() methods. By default, it'll use all non-static, non-transient fields, but you can modify which fields are used (and even specify that the output of ..
No need to start a debugger to see your fields: Just let lombok generate a toString for you! Overview Any class definition may be annotated with @ToString to let lombok generate an implementation of the toString() method. By default, it'll print your class name, along with each field, in order, separated by commas. By setting the includeFieldNames parameter to true you can add some clarity (but ..
Never write public int getFoo() {return foo;} again. Overview You can annotate any field with @Getter and/or @Setter, to let lombok generate the default getter/setter automatically. A default getter simply returns the field, and is named getFoo if the field is called foo (or isFoo if the field's type is boolean). A default setter is named setFoo if the field is called foo, returns void, and take..
@Cleanup Automatic resource management: Call your close() methods safely with no hassle. Overview You can use @Cleanup to ensure a given resource is automatically cleaned up before the code execution path exits your current scope. You do this by annotating any local variable declaration with the @Cleanup annotation like so: @Cleanup InputStream in = new FileInputStream("some/file"); As a result,..
@NonNull or: How I learned to stop worrying and love the NullPointerException. @NonNull was introduced in lombok v0.11.10. Overview You can use @NonNull on the parameter of a method or constructor to have lombok generate a null-check statement for you. Lombok has always treated various annotations generally named @NonNull on a field as a signal to generate a null-check if lombok generates an ent..