package com.apobates.forum.core.entity.proxy;

import com.apobates.forum.core.entity.Board;
import com.apobates.forum.core.entity.BoardGroup;
import com.apobates.forum.core.entity.Posts;
import com.apobates.forum.core.entity.Topic;
import com.apobates.forum.member.entity.Member;
import com.apobates.forum.utils.lang.ForumReplicable;
import java.util.function.Function;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author xiaofanku
 * @since 20200512
 */
public final class PostsReplica extends Posts implements ForumReplicable<Posts,PostsReplica>{
    //可能有值可能无值
    private Topic topic;
    private Board board; //策略需要+版主+配置文件
    private BoardGroup volumes;
    private Member member;
    private final static Logger logger = LoggerFactory.getLogger(PostsReplica.class);
    public static Function<Posts,PostsReplica> copyPosts = (Posts posts) -> {
        return ForumReplicable.replica(posts, PostsReplica.class).orElseGet(PostsReplica::new);
    };
    
    public PostsReplica(){
        super();
    }
    
    public void setTopic(Topic topic){
        this.topic = topic;
    }
    public Topic getTopic() {
        return topic;
    }
    //
    public Board getBoard() {
        return board;
    }
    public void setBoard(Board board){
        this.board = board;
    }
    //
    public BoardGroup getVolumes() {
        return volumes;
    }
    public void setVolumes(BoardGroup boardGroup){
        this.volumes = boardGroup;
    }
    //
    public Member getMember() {
        return member;
    }
    public void setMember(Member member){
        this.member = member;
    }
}