-
Notifications
You must be signed in to change notification settings - Fork 1
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
2 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
41 changes: 38 additions & 3 deletions
41
src/main/java/com/study/realworld/domain/follow/domain/Follow.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 |
---|---|---|
@@ -1,9 +1,44 @@ | ||
package com.study.realworld.domain.follow.domain; | ||
|
||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | ||
|
||
import javax.persistence.Entity; | ||
import com.study.realworld.domain.user.domain.User; | ||
|
||
public class Follow { | ||
|
||
private User following; | ||
private User follower; | ||
|
||
protected Follow() { | ||
} | ||
|
||
private Follow(final FollowBuilder followBuilder) { | ||
following = followBuilder.following; | ||
follower = followBuilder.follower; | ||
} | ||
|
||
public static FollowBuilder Builder() { | ||
return new FollowBuilder(); | ||
} | ||
|
||
public static final class FollowBuilder { | ||
private User following; | ||
private User follower; | ||
|
||
private FollowBuilder() { | ||
} | ||
|
||
public FollowBuilder following(final User following) { | ||
this.following = following; | ||
return this; | ||
} | ||
|
||
public FollowBuilder follower(final User follower) { | ||
this.follower = follower; | ||
return this; | ||
} | ||
|
||
public Follow build() { | ||
return new Follow(this); | ||
} | ||
} | ||
|
||
} |
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