-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Security E | ||
|
||
一群山上工程師下班後交流技術的園地 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# 程式語言 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Project Lombok | ||
|
||
在撰寫 Java 時, 常常會遇到一些看似很冗的程式碼, 但又不得不寫, 此時 Lombok 就派上用場了 | ||
|
||
## 又愛又恨的 Getter & Setter | ||
|
||
大家想必對以下的程式碼不陌生 | ||
|
||
```java | ||
public class Person { | ||
private String name; | ||
private String job; | ||
|
||
public String getName() { | ||
return this.name; | ||
} | ||
|
||
void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getJob() { | ||
return this.job; | ||
} | ||
|
||
void setJob(String job) { | ||
this.job = job; | ||
} | ||
} | ||
``` | ||
|
||
只要在屬性上加上 `@Getter/@Setter` 的標記以後, Lombok 就會在編譯時自動將上述的程式碼產生出來 | ||
|
||
```java | ||
public class Person { | ||
@Getter @Setter private String name; | ||
@Getter @Setter private String job; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters