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

jsonvalues.spec.JsValuePredicate Maven / Gradle / Ivy

package jsonvalues.spec;


import jsonvalues.JsPath;
import jsonvalues.JsValue;

import java.util.HashSet;
import java.util.Optional;
import java.util.Set;

interface JsValuePredicate extends JsSpec {

    default Set test(final JsPath parentPath,
                                  final JsValue value
                                 ) {
        Set errors = new HashSet<>();
        test(value).ifPresent(e -> errors.add(JsErrorPair.of(parentPath,
                                                             e
                                                            )
                                             )
                             );
        return errors;
    }

    Optional test(final JsValue value);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy