nl.vpro.domain.constraint.DelegatingDisplayablePredicate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-domain Show documentation
Show all versions of api-domain Show documentation
Contains the objects used by the Frontend API, like forms and result objects
package nl.vpro.domain.constraint;
import java.util.Arrays;
import java.util.List;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
* @author Michiel Meeuwissen
* @since 4.8
*/
public interface DelegatingDisplayablePredicate extends DisplayablePredicate {
@Override
default boolean test(@Nullable T value) {
DisplayablePredicate predicate = getPredicate();
return predicate == null || predicate.test(value);
}
@Override
default PredicateTestResult testWithReason(T input) {
DisplayablePredicate predicate = getPredicate();
return predicate == null ? DisplayablePredicates.testsTrue(this, input) : predicate.testWithReason(input);
}
@Override
default List getDefaultBundleKey() {
DisplayablePredicate predicate = getPredicate();
return predicate == null ? Arrays.asList("default") : getPredicate().getDefaultBundleKey();
}
DisplayablePredicate getPredicate();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy