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

panda.el.opt.logic.Logics Maven / Gradle / Ivy

Go to download

Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.

There is a newer version: 1.8.0
Show newest version
package panda.el.opt.logic;

import panda.lang.Objects;

public class Logics {

	public static boolean isTrue(Object o) {
		if (o == null) {
			return false;
		}
		if (o instanceof Boolean) {
			return ((Boolean)o).booleanValue();
		}
		if (o instanceof Number) {
			return ((Number)o).intValue() != 0;
		}
		return Objects.isNotEmpty(o);
	}

	public static boolean isFalse(Object o) {
		if (o == null) {
			return true;
		}
		if (o instanceof Boolean) {
			return !((Boolean)o).booleanValue();
		}
		if (o instanceof Number) {
			return ((Number)o).intValue() == 0;
		}
		return Objects.isEmpty(o);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy