package me.chyxion.tigon.form;

import lombok.Getter;
import me.chyxion.tigon.validation.annotation.NotNullOrBlank;

/**
 * @version 0.0.1
 * @since 0.0.1
 * @author Shaun Chyxion <br>
 * chyxion@163.com <br>
 * Oct 8, 2016 6:26:19 PM
 */
public class FC2<CreatorId> extends FC1 {
    private static final long serialVersionUID = 1L;
    private transient boolean __lock = true;

    @Getter
    @NotNullOrBlank
    protected CreatorId createdBy;

    /**
     * set created by
     * @param createdBy created by
     */
    public void setCreatedBy(final CreatorId createdBy) {
        if (!__lock) {
            this.createdBy = createdBy;
            __lock = true;
        }
    }

    /**
     * unlock set created by
     */
    public void unlock() {
        __lock = false;
    }
}
