
org.fuwjax.oss.util.assertion.Assertions Maven / Gradle / Ivy
/*
* Copyright (C) 2015 fuwjax.org ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.fuwjax.oss.util.assertion;
import org.fuwjax.oss.util.RunWrapException;
import org.fuwjax.oss.util.collection.ReflectList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.Callable;
import java.util.function.Predicate;
import java.util.function.Supplier;
import static org.fuwjax.oss.util.assertion.Assertion.toExpected;
import static org.fuwjax.oss.util.function.Functions.runnable;
/**
* Created by fuwjax on 1/25/15.
*/
public class Assertions {
public static void assertThat(T value, Assertion super T> assertion){
assertion.expects(value);
}
public static Assertion asserts(Supplier expected, Predicate test){
return new Assertion(){
@Override
public Supplier expected() {
return expected;
}
@Override
public boolean test(T value) {
return test.test(value);
}
};
}
public static Assertion
© 2015 - 2025 Weber Informatics LLC | Privacy Policy