package de.avatic.lcc.util;

import de.avatic.lcc.util.exception.base.BadRequestException;

public class Check {



    public static <O1,O2> void equals(O1 o1, O2 o2) {

        if(o1 == null && o2 == null) {
            return;
        }

        if(o1 == null || o2 == null) {
            throw new BadRequestException("Should be equal", "Objects should be equal " + o1 + " " + o2, null);
        }

        if(!o1.equals(o2)) {
            throw new BadRequestException("Should be equal", "Objects should be equal " + o1 + " " + o2, null);
        }
    }
}
