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

io.magentys.utils.Requires Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
package io.magentys.utils;

import io.magentys.exceptions.RequirementException;

public class Requires {

    public static void requires(final Boolean condition, final String errorMessage) {
        if (!condition) {
            throw new RequirementException(errorMessage);
        }
    }

    public static  T requiresNotNull(final T value, final String errorMessage) {
        if (value == null) {
            throw new RequirementException(errorMessage);
        }
        return value;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy