io.polyglotted.eswrapper.services.ValidityException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of es-wrapper Show documentation
Show all versions of es-wrapper Show documentation
Standard set of utilities for elastic search abstraction
package io.polyglotted.eswrapper.services;
import com.google.common.collect.ImmutableMap;
import java.util.Map;
public class ValidityException extends IndexerException {
protected ValidityException(ImmutableMap errorsMap) {
super(errorsMap);
}
public static void failedValidity(boolean condition, String message) {
if (!condition) {
throw new ValidityException(ImmutableMap.of("ERROR_MESSAGE", "validation failed:" + message));
}
}
public static void checkValidity(Map validations) {
if (!validations.isEmpty()) {
throw new ValidityException(ImmutableMap.of("ERROR_MESSAGE",
buildFailureMessage("validation failed:", validations), "ERRORS", validations));
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy