com.github.cowwoc.requirements10.java.JavaValidators Maven / Gradle / Ivy
The newest version!
/*
* Copyright (c) 2017 Gili Tzabari
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
package com.github.cowwoc.requirements10.java;
import com.github.cowwoc.requirements10.annotation.CheckReturnValue;
import com.github.cowwoc.requirements10.java.internal.Configuration;
import com.github.cowwoc.requirements10.java.internal.scope.MainApplicationScope;
import com.github.cowwoc.requirements10.java.internal.validator.JavaValidatorsImpl;
/**
* Creates validators for the Java API with an independent configuration.
*
* A factory that creates different types of validators.
*
* There are three kinds of validators:
*
* - {@code requireThat()} for method preconditions.
* - {@code assert that()} for class invariants, and method postconditions.
* - {@code checkIf()} for returning multiple validation failures.
*
*/
public interface JavaValidators
extends Validators, JavaRequireThat, JavaAssertThat, JavaCheckIf
{
/**
* Creates a new instance using the default configuration.
*
* @return an instance of this interface
*/
static JavaValidators newInstance()
{
return new JavaValidatorsImpl(MainApplicationScope.INSTANCE, Configuration.DEFAULT);
}
@Override
@CheckReturnValue
JavaValidators copy();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy