package com.brilliance.isc.vo.model;

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 CbbVo max;

    
    private CbbVo opn1;

    
    private CbbVo max2;

    
    private CbbVo opn2;

    
    private CbbVo cnf;

    
    private CbbVo maxinf;

    
    private CbbVo opninf;

    
    private CbbVo mac;

    
    private CbbVo mac2;

    
    private CbbVo opc1;

    
    private CbbVo opc2;

    private CbbVo opnint;

    private CbbVo maxint;


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

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