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

org.ligoj.app.api.NodeStatus Maven / Gradle / Ivy

The newest version!
/*
 * Licensed under MIT (https://github.com/ligoj/ligoj/blob/master/LICENSE)
 */
package org.ligoj.app.api;

/**
 * node status
 */
public enum NodeStatus {
	/**
	 * node is up
	 */
	UP,
	/**
	 * node is down
	 */
	DOWN;

	/**
	 * is status up ?
	 *
	 * @return true if up
	 */
	public boolean isUp() {
		return this == UP;
	}

	/**
	 * get status
	 *
	 * @param isUp is up ?
	 * @return status
	 */
	public static NodeStatus getValue(final boolean isUp) {
		if (isUp) {
			return UP;
		}
		return DOWN;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy