package com.gic.haoban.manage.api.dto;

import com.alibaba.fastjson.JSON;

public class ClerkEditInfoDTO {

    private int editClerkFlag ;  // 1
    private int addClerkFlag ;   // 2
    private int delClerkFlag ;   // 4
    public int getEditClerkFlag() {
        return editClerkFlag;
    }
    public int getAddClerkFlag() {
        return addClerkFlag;
    }
    public int getDelClerkFlag() {
        return delClerkFlag;
    }
    public void setEditClerkFlag(int editClerkFlag) {
        this.editClerkFlag = editClerkFlag;
    }
    public void setAddClerkFlag(int addClerkFlag) {
        this.addClerkFlag = addClerkFlag;
    }
    public void setDelClerkFlag(int delClerkFlag) {
        this.delClerkFlag = delClerkFlag;
    }
    
    public static ClerkEditInfoDTO info(int v) {
        ClerkEditInfoDTO vo = new ClerkEditInfoDTO();
        vo.setEditClerkFlag(v & 1);
        vo.setAddClerkFlag((v & 2) >> 1);
        vo.setDelClerkFlag((v & 4) >> 2);
        return vo ;
    }
    
    public static int getValue(ClerkEditInfoDTO vo) {
        int editClerkFlag = vo.getEditClerkFlag() ;
        int addClerkFlag = vo.getAddClerkFlag() << 1;
        int delClerkFlag = vo.getDelClerkFlag() << 2;
        return editClerkFlag | addClerkFlag | delClerkFlag ;
    }
}
