Skip to content

Commit

Permalink
[#52] feat: static 팩토리 메소드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyoungchoi95 committed Sep 20, 2021
1 parent 1e83963 commit 3409480
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/main/java/com/study/realworld/user/domain/Bio.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ public class Bio {
protected Bio() {
}

public Bio(String bio) {
private Bio(String bio) {
this.bio = bio;
}

public static Bio of(String bio) {
return new Bio(bio);
}

public String value() {
return bio;
}
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/study/realworld/user/domain/Image.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ public class Image {
protected Image() {
}

public Image(String url) {
private Image(String url) {
this.url = url;
}

public static Image of(String url) {
return new Image(url);
}

public String value() {
return url;
}
Expand Down

0 comments on commit 3409480

Please sign in to comment.