All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tngtech.jgiven.impl.util.ApiUtil Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version
package com.tngtech.jgiven.impl.util;

import com.tngtech.jgiven.exception.JGivenWrongUsageException;

/**
 * This util is used for checking inputs of API methods
 */
public class ApiUtil {

    public static  T notNull(T o, String message) {
        if (o == null) {
            throw new JGivenWrongUsageException(message);
        }
        return o;
    }

    public static void isTrue(boolean b, String message) {
        if (!b) {
            throw new JGivenWrongUsageException(message);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy