/*
 * Decompiled with CFR 0.152.
 */
package com.hst.common.util;

public class Assert {
    public static void isTrue(boolean expression, String message) {
        if (!expression) {
            throw new IllegalArgumentException(message);
        }
    }

    public static void isTrue(boolean expression) {
        Assert.isTrue(expression, "[Assertion failed] - this expression must be true");
    }

    public static void notNull(Object object, String message) {
        if (object == null) {
            throw new IllegalArgumentException(message);
        }
    }

    public static void notNull(Object object) {
        Assert.notNull(object, "[Assertion failed] - this argument is required; it cannot be null");
    }

    public static void isNull(Object object, String message) {
        if (object != null) {
            throw new IllegalArgumentException(message);
        }
    }

    public static void isNull(Object object) {
        Assert.isNull(object, "[Assertion failed] - the object argument must be null");
    }

    public static void checkNullOrEmpty(String paramName, String paramValue) {
        if (paramValue == null) {
            throw new NullPointerException("The " + paramName + " should not be null.");
        }
        if (paramValue.trim().length() == 0) {
            throw new IllegalArgumentException("The " + paramName + " should not be empty.");
        }
    }

    public static void checkNull(String paramName, Object paramValue) {
        if (paramValue == null) {
            throw new NullPointerException("The " + paramName + " should not be null.");
        }
    }

    public static void checkNullOrEmpty(String paramName, String[] paramValues) {
        if (paramValues == null) {
            throw new NullPointerException("The " + paramName + " should not be null.");
        }
        int i = 0;
        while (i < paramValues.length) {
            if (paramValues[i] == null) {
                throw new NullPointerException("The " + paramName + " should not have one null element.");
            }
            if (paramValues[i].trim().length() == 0) {
                throw new IllegalArgumentException("The " + paramName + " should not have one empty element.");
            }
            ++i;
        }
    }

    public static void checkNull(String paramName, Object[] paramValues) {
        if (paramValues == null) {
            throw new NullPointerException("The " + paramName + " should not be null.");
        }
        int i = 0;
        while (i < paramValues.length) {
            if (paramValues[i] == null) {
                throw new NullPointerException("The " + paramName + " should not have one null element.");
            }
            ++i;
        }
    }

    public static boolean isNullOrEmpty(String param) {
        if (param == null) {
            return true;
        }
        return param.trim().length() == 0;
    }

    public static boolean isNullObject(Object param) {
        return param == null;
    }

    public static boolean isNullOrEmpty(String[] params) {
        if (params == null) {
            return true;
        }
        int i = 0;
        while (i < params.length) {
            if (params[i] == null) {
                return true;
            }
            if (params[i].trim().length() == 0) {
                return true;
            }
            ++i;
        }
        return false;
    }

    public static boolean isNullObjects(Object[] params) {
        if (params == null) {
            return true;
        }
        int i = 0;
        while (i < params.length) {
            if (params[i] == null) {
                return true;
            }
            ++i;
        }
        return false;
    }

    public static boolean isNullOrEmpty(Object[] params) {
        if (params == null) {
            return true;
        }
        if (params.length == 0) {
            return true;
        }
        int i = 0;
        while (i < params.length) {
            if (params[i] == null) {
                return true;
            }
            ++i;
        }
        return false;
    }
}
