package com.brilliance.isc.bo.model;

import com.brilliance.isc.bo.Cbb;
import com.brilliance.isc.bo.Gid;
import com.brilliance.isc.bo.Git;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import java.lang.reflect.Field;
import java.util.Map;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class Giacbs {
    
    private Cbb max;

    
    private Cbb opn1;

    
    private Cbb max2;

    
    private Cbb opn2;

    
    private Cbb cnf;

    
    private Cbb maxinf;

    
    private Cbb opninf;

    
    private Cbb mac;

    
    private Cbb mac2;

    
    private Cbb opc1;

    
    private Cbb opc2;

    private Cbb opnint;

    private Cbb maxint;


    public void fillToMap(Map<String,Cbb> cbsMap){
        for (Field field : this.getClass().getDeclaredFields()) {
            if(Cbb.class == field.getType()){
               field.setAccessible(true);
                Cbb cbb = null;
                try {
                    cbb = (Cbb)field.get(this);
                } catch (IllegalAccessException e) {
                }
                if(cbb != null){
                    cbsMap.put(field.getName().toUpperCase(),cbb);
                }
            }
        }
    }

    public void reset() {
        if (max == null) {
            max = new Cbb();
        }
        if (opn1 == null) {
            opn1 = new Cbb();
        }
        if (max2 == null) {
            max2 = new Cbb();
        }
        if (opn2 == null) {
            opn2 = new Cbb();
        }
        if (cnf == null) {
            cnf = new Cbb();
        }
        if (maxinf == null) {
            maxinf = new Cbb();
        }
        if (opninf == null) {
            opninf = new Cbb();
        }
        if (mac == null) {
            mac = new Cbb();
        }
        if (mac2 == null) {
            mac2 = new Cbb();
        }
        if (opc1 == null) {
            opc1 = new Cbb();
        }
        if (opc2 == null) {
            opc2 = new Cbb();
        }
        if (opnint == null) {
            opnint = new Cbb();
        }
        if (maxint == null) {
            maxint = new Cbb();
        }
    }
}
