IADConfig.java 769 Bytes
package com.controller;

import java.util.Random;

public class IADConfig {
    private boolean open;
    private int type;

    public IADConfig(boolean isOpen,int type){
        this.open = isOpen;
        if(type >2){
            type = new Random().nextInt(3);
        }
        this.type = type;
    }

    public IADConfig(){
    }

    public boolean isOpen() {
        return open;
    }

    public void setOpen(boolean open) {
        this.open = open;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        if(type >2){
            type = new Random().nextInt(2);
        }
        this.type = type;
    }

    @Override
    public String toString() {
        return "open="+open+"     type="+type;
    }
}