package core.utils;

import core.operation.Operation;
import core.user.User;

public interface GetObjectByName {
    String userClassPath = "core.user";
    String operationClassPath = "core.operation";
    static User getUserByName(String name) throws Exception {
        return (User)Class.forName(userClassPath+"."+utils.Utils.toUpperFirstChar(name)).getDeclaredConstructor().newInstance();
    }
    static Operation getOperationByName(String name) throws Exception{
        return (Operation)Class.forName(operationClassPath+"."+utils.Utils.toUpperFirstChar(name)).getDeclaredConstructor().newInstance();
    }
}
