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

nl.vpro.domain.constraint.DelegatingDisplayablePredicate Maven / Gradle / Ivy

Go to download

Contains the objects used by the Frontend API, like forms and result objects

There is a newer version: 8.3.3
Show newest version
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