Java? ?? getter, setter, ??? ? toString ???? ?? ???? ??? ??? ??? ? ??? ??? ??? ????. ????? ??? ??? ???? ?? ?? ??? ???? ??? ?? ?? ????? ? ???? ? ????. Project Lombok? ??? ??? ??? ??? ???? ???? ? ??? ?????.
? ?????? Lombok? Java? ?? ??? ??? ?? ???? ??? ?? ??? ????, Lombok? ?? ??? ???? Java Abstract? ???? ???? ??? ???? ?? ?? ??? ???????. ?? ??(AST)? ???? ??? ???? ?? ??? ???? ?? ? ????.
? ??? ??????
Java?? ??? ?? ??? ??? ?????. ??, ???, getter, setter ? toString ???? ???? ??? POJO? ??? ???.
public class User { private String name; private int age; public User(String name, int age) { this.name = name; this.age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } @Override public String toString() { return "User{name='" + name + "', age=" + age + '}'; } }
??? ??????? ??? ????? ?????? ??? ??? ???? ?? ?????? ? ????.
???: ??
Lombok? ???? ??? ???? ??? ?? ?? ? ????. Lombok? ??? ??? ???? ??? ??? ????.
import lombok.Data; @Data public class User { private String name; private int age; }
? ??? ???? Lombok? getter, setter, toString, equals ? hashCode ???? ???? ??? ? ???? ?? ???? ?? ????.
??? ???? ??
1??: Lombok ??? ??
Maven ?????? Lombok? ????? pom.xml? ?? ???? ?????.
<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.28</version> <scope>provided</scope> </dependency>
Gradle? ??:
compileOnly 'org.projectlombok:lombok:1.18.28' annotationProcessor 'org.projectlombok:lombok:1.18.28'
2??: IDE ??
IDE? Lombok ????? ???? ??? ?????. IntelliJ IDEA??:
1. Go to Settings > Plugins. 2. Search for Lombok. 3. Install the Lombok plugin. 4. Enable annotation processing under Settings > Build, Execution, Deployment > Compiler > Annotation Processors.
?? ?? ??: ???? ???
?? ??? ?
Lombok? Java Annotation Processor? ???? Java Abstract Syntax Tree(AST)? ???????. ?? ????? ??? ???? ?? ?? ??? ???? ????? ?????. Lombok? ?? ????? ?? ???? ??? ????? ?? getter, setter ? toString? ?? ???? AST? ?? ???? ?????.
?? ?? ??(AST) ??
AST? ??? ?? ????, ??? ????? ??? ? ?? ???? ??? ?????. Java ??? ??? ? ? ??(?: ???, ??, ???)? AST? ??? ?????.
Lombok? ?? ????? Lombok ??? ?? ???? ???? AST ??? ???? ??? ?? ???? ?????. ?? ??? ???? ??? ?? ???? ?? ??? ??? ???? ?? ?????. ??? ???? ??? ??? ?? ???? ???? ???? ?????.
???: Lombok? ??? ???? ??? ??
Lombok? ??? Java ?? ?? ?? ??? ????? ?? ??? ??? ???? ?????. ??? ????? ??? ????.
public class User { private String name; private int age; public User(String name, int age) { this.name = name; this.age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } @Override public String toString() { return "User{name='" + name + "', age=" + age + '}'; } }
????? ??? ???? getter, setter ? ?? ???? ??? ??? ??????? ???? ?? ?? ??? ??? ??? ?????.
?? ?? ??
- @Getter ? @Setter
??? ??? ??? ?? getter ? setter ???? ???? ?? ???? ??? ????? ?????.
import lombok.Data; @Data public class User { private String name; private int age; }
- @ToString
@ToString? ?? ??? ???? ??? ?? ????? ?? ??? ???? toString ???? ?????.
<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.28</version> <scope>provided</scope> </dependency>
- @EqualsAndHashCode
equals ? hashCode ???? ?????. ??? ??? ??? ???? HashMap ?? HashSet? ?? ????? ???? ? ??????.
compileOnly 'org.projectlombok:lombok:1.18.28' annotationProcessor 'org.projectlombok:lombok:1.18.28'
- @NoArgsConstructor, @AllArgsConstructor ? @RequiredArgsConstructor
??? ??? ??? ???? ??? ???? ???? ?????.
1. Go to Settings > Plugins. 2. Search for Lombok. 3. Install the Lombok plugin. 4. Enable annotation processing under Settings > Build, Execution, Deployment > Compiler > Annotation Processors.
1. AST Creation: The compiler reads the Java source code and generates the AST. 2. Annotation Processing: Lombok’s annotation processor scans the AST for Lombok annotations. 3. AST Manipulation: When an annotation like @Getter or @Setter is found, Lombok adds nodes to the AST to represent the corresponding methods. 4. Bytecode Generation: The modified AST is used to generate the final bytecode, which includes the methods added by Lombok.
- @???
@Getter, @Setter, @ToString, @EqualsAndHashCode ? @RequiredArgsConstructor? ?????.
import lombok.Getter; import lombok.Setter; @Getter @Setter public class User { private String name; private int age; }
- @??
?? ????? ???? ??? ??? ???? ? ?? ??? ?? ??? ?????.
import lombok.ToString; @ToString(exclude = ?password“) public class User { private String name; private int age; private String password; }
???:
import lombok.EqualsAndHashCode; @EqualsAndHashCode public class User { private String name; private int age; }
- @Slf4j(??)
SLF4J Logger ????? ???? ?? ??? ??????.
? @NoArgsConstructor: No-argument constructor. ? @AllArgsConstructor: Constructor with parameters for all fields. ? @RequiredArgsConstructor: Constructor for fields marked final or @NonNull.
Spring Boot ??????? Lombok
Lombok? ??? ??? ??? ???, ??? ? ??? ?? ??? ? ?? Spring Boot ??????? ?? ?????. ??? Spring Boot ????? Lombok? ???? ????.
import lombok.NoArgsConstructor; import lombok.AllArgsConstructor; import lombok.RequiredArgsConstructor; @NoArgsConstructor @AllArgsConstructor @RequiredArgsConstructor public class User { private final String name; private int age; }
? ????:
import lombok.Data; @Data public class User { private String name; private int age; }
??
Lombok? Java ????? ??? ?????. ??? ??? ?? ??? ???? ???? ???? ???? ??????. ?? ??? ???? AST? ?????? Lombok? ??? ?? ???? ?? ???? ?? ?? ?? ?? ???? ?????.
Spring Boot? ???? Lombok? ??? ?? ??????. @Data, @Builder ? @Slf4j? ?? ??? ?? ? ???? ?? ???? ?? ??? ??? ??? ???? ??? ??? ?????.
Java? ???? ?? Lombok? ??? ? ??? ???. Lombok? ??? ? ??? ? ?? ???? ? ?? ??? ??????
? ??? Project Lombok?? Java ??: ?? ???, ??? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











?? ?? ?? ??? ??? ?? ??? ??, ? ? ?? ? ??? ?????. 1. ??? ?? ???? ?? ???? ???-????, ? ??? ??? ??? ? ????, Hashmap? ???-??? ?? ??? ??? ???? ????. 2. NULL ? ?? ???? HashMap? ??? NULL ?? ?? ? ?? ???? ?? HashTable? NULL ?? ?? ???? ??? NullPointerException? ?????. 3. ????? ??? ????? ?? ??? ?? ?? ? ????? HashTable? ? ??? ?? ?? ??? ????. ?? ConcurrenTashMap? ???? ?? ????.

Java? ?? ??? ??? ?? ??? ??? ?? ??? ??? ?? ??? ?? ?? ??? ???? ??? ?? ???? ?????. 1. ??? ???? ??? ?? ?? ? ???? ?? ??? ???? ?? ?? ??? ? ????. 2. ???? ?? ??? ???? ??? ?? ???? ?? ?? ??? ???????. 3. ?? ???? ?? ?? ?? ? ???? ???? ?? NULL ?? ??? ? ????. 4. ?? ???? ??? ?? ?? ? ??? ?????? ?? ??? ??? ?? ?? ??? ????? ??? ??? ??? ??????? ?? ???? ??????.

staticmethodsininterfaceswereIntRectionSelffacesswithinteffaceswithinteffaceswithintintinjava8toallowutilityFunctionswithinterfaceitswithinteffaceswithinterfaceffaces

JIT ????? ??? ???, ??? ?? ? ???, ?? ?? ? ???? ? ? ?? ?? ??? ? ?? ??? ?? ??? ??????. 1. ??? ???? ?? ?? ??? ??? ?? ?? ???? ??? ?? ?????. 2. ??? ?? ? ??? ?? ?? ? ??? ???? ?? ?? ???; 3. ?? ??? ??? ?? ??? ???? ???? ???? ? ?? ?? ??? ?????. 4. ?? ??? ?? ??? ??? ???? ???? ?? ? ??? ???? ?? ??? ?????.

???? ??? ??? Java?? ??? ?? ???? ??? ?? ? ? ??? ??? ???? ? ?????. ?? ???? ??? ??, ??? ?? ??? ?? ?? ??? ??? ????? ???? ????? ?????. ?? ??? ??? ??, ????? ? ??? ????, ?? ??? ??? ?????? ? ?? ? ?? ?????.

??? ??? ?? ?? ??? ????? ? ???? ????? ???? ?? ???? ?? ???? ?????. ?? ??? ??? ????. ?? ?? ?? ??? ???? ???? ?? ?? ??? ??? ?? ?? ??? ??? ?????. ?? ??? ??? ????. ?? ??? ?? ??? ?? ?? ??? ?? ?? ??? ???? NewClass ()? ??? ?? ???? ????. ?? ??? ?? ??? ???? ?? ??? ?? ? ? ??? ?? ?? ??? ????? ????? ?????. ?? ??, ?? ?????? ?????, ??? ? ?? ????? ??? ?? ?????. ???? ?? ?? ??? ???? ?? ???? ?? ? ??? ???? ?? ??? ?? ?????? ?????. ???? ???? ??? ??, ?? ?? ? ?? ??? ????, ?? ?? ???? ?????.

injava, thefinalkeywordpreventsavariable'svalue'svalueffrombeingchangedafterassignment, butitsbehaviordiffersforprimitivesandobjectreences.forprimitivevariables, asinfinalintmax_speed = 100; wherereassoncesanerror.forobjectref

??? ? ?? ??? ???? : ????? ?? ?. 1. int? ???? ???? ?? ?? ?? ? ??? ???? ?????. 2. ?? ? ???? (int) myDouble ??? ?? ?? ??? ?????. ?? ??? ??? ?? ??? ?? ??, ?? ?? ?? ???? ?? ??? ?? ???? ?? ?????. ???? ? ??? ??? ????. ?? ??? ??? ??? ??? ??? ?? ??? ??? ? ??? ?? ???? ??? ??? ??? ??? ? ??? ?? ??? ?? ??? ?? ?? ? ? ????. ?? ?? ??? ?? ??? ??? ??? ??? ? ??????.
