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

com.softicar.platform.common.core.user.BasicUsers Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.core.user;

import java.util.Objects;

/**
 * Utility methods for {@link IBasicUser}.
 *
 * @author Oliver Richers
 */
interface BasicUsers {

	/**
	 * Compares the two given users for identity.
	 *
	 * @param userA
	 *            the first user (may be null)
	 * @param userB
	 *            the second user (may be null)
	 * @return true if both users are identical; false otherwise
	 */
	static boolean isSame(IBasicUser userA, IBasicUser userB) {

		if (userA == null || userB == null) {
			return false;
		} else {
			Integer idA = userA.getId();
			Integer idB = userB.getId();
			return Objects.equals(idA, idB) && idA != null;
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy