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

com.brambolt.util.Require Maven / Gradle / Ivy

There is a newer version: 2022.05.01-7057
Show newest version
package com.brambolt.util;

import java.util.Collection;

public class Require {

    public static void notEmpty(Collection c) {
        assert(null != c && !c.isEmpty());
    }

    public static void notEmpty(String s) {
        assert(null != s && !s.isEmpty());
    }

    public static void notNull(Object o) {
        assert(null != o);
    }

    public static void positive(int i) {
        assert(0 < i);
    }

    public static void nonNegative(int i) {
        assert(-1 < i);
    }

    public static void negative(int i) {
        assert(i < 0);
    }

    public static void nonPositive(int i) {
        assert(i < 1);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy