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:36 PM
 */
public class FU2<EditorId, Id>
    extends FU1<Id> {
    private static final long serialVersionUID = 1L;
    private transient boolean __lock = true;

    @Getter
    @NotNullOrBlank
    private EditorId updatedBy;

    /**
     * set updated by
     * @param updatedBy updated by
     */
    public void setUpdatedBy(final EditorId updatedBy) {
        if (!__lock) {
            this.updatedBy = updatedBy;
            __lock = true;
        }
    }

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