com.softicar.platform.common.core.utils.equals.Equals 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.utils.equals;
import java.util.function.Function;
/**
* This class provides a facility to implement {@link Object#equals}.
*
* @author Oliver Richers
*/
public abstract class Equals {
/**
* Creates a new {@link IEqualsComparer} based on the given key extractor.
*
* The given key extractor need not be null-safe, that is, it can assume
* that its parameter will never be null.
*
* @param keyExtractor
* the key extractor (never null)
* @return a new {@link IEqualsComparer} that uses the given key extractor
* (never null)
*/
public static IEqualsComparer comparing(Function keyExtractor) {
return new EqualsKeyExtractor<>(keyExtractor);
}
}