com.softicar.platform.common.core.user.BasicUsers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
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;
}
}
}