/** * Verifies that each element value satisfies the given condition * <p> * Example : * <pre><code class='java'> AtomicReferenceArray<String> abc = new AtomicReferenceArray<>(new String[]{"a", "b", "c"}); * AtomicReferenceArray<String> abcc = new AtomicReferenceArray<>(new String[]{"a", "b", "cc"}); * * Condition<String> singleCharacterString * = new Condition<>(s -> s.length() == 1, "single character String"); * * // assertion will pass * assertThat(abc).are(singleCharacterString); * * // assertion will fail * assertThat(abcc).are(singleCharacterString);</code></pre> * * @param condition the given condition. * @return {@code this} object. * @throws NullPointerException if the given condition is {@code null}. * @throws AssertionError if an element cannot be cast to T. * @throws AssertionError if one or more elements don't satisfy the given condition. */ @Override public AtomicReferenceArrayAssert<T> are(Condition<? super T> condition) { arrays.assertAre(info, array, condition); return myself; }
/** * Verifies that each element value satisfies the given condition * <p> * Example : * <pre><code class='java'> String[] abc = {"a", "b", "c"}; * String[] abcc = {"a", "b", "cc"}; * * Condition<String> singleCharacterString * = new Condition<>(s -> s.length() == 1, "single character String"); * * // assertion will pass * assertThat(abc).are(singleCharacterString); * * // assertion will fail * assertThat(abcc).are(singleCharacterString);</code></pre> * * @param condition the given condition. * @return {@code this} object. * @throws NullPointerException if the given condition is {@code null}. * @throws AssertionError if an element cannot be cast to ELEMENT. * @throws AssertionError if one or more elements don't satisfy the given condition. */ @Override public SELF are(Condition<? super ELEMENT> condition) { arrays.assertAre(info, actual, condition); return myself; }
/** * Verifies that each element value satisfies the given condition * <p> * Example : * <pre><code class='java'> String[] abc = {"a", "b", "c"}; * String[] abcc = {"a", "b", "cc"}; * * Condition<String> singleCharacterString * = new Condition<>(s -> s.length() == 1, "single character String"); * * // assertion will pass * assertThat(abc).are(singleCharacterString); * * // assertion will fail * assertThat(abcc).are(singleCharacterString);</code></pre> * * @param condition the given condition. * @return {@code this} object. * @throws NullPointerException if the given condition is {@code null}. * @throws AssertionError if an element cannot be cast to ELEMENT. * @throws AssertionError if one or more elements don't satisfy the given condition. */ @Override public SELF are(Condition<? super ELEMENT> condition) { arrays.assertAre(info, actual, condition); return myself; }
/** * Verifies that each element value satisfies the given condition * <p> * Example : * <pre><code class='java'> AtomicReferenceArray<String> abc = new AtomicReferenceArray<>(new String[]{"a", "b", "c"}); * AtomicReferenceArray<String> abcc = new AtomicReferenceArray<>(new String[]{"a", "b", "cc"}); * * Condition<String> singleCharacterString * = new Condition<>(s -> s.length() == 1, "single character String"); * * // assertion will pass * assertThat(abc).are(singleCharacterString); * * // assertion will fail * assertThat(abcc).are(singleCharacterString);</code></pre> * * @param condition the given condition. * @return {@code this} object. * @throws NullPointerException if the given condition is {@code null}. * @throws AssertionError if an element cannot be cast to T. * @throws AssertionError if one or more elements don't satisfy the given condition. */ @Override public AtomicReferenceArrayAssert<T> are(Condition<? super T> condition) { arrays.assertAre(info, array, condition); return myself; }
/** {@inheritDoc} */ @Override public S are(Condition<? super T> condition) { arrays.assertAre(info, actual, condition); return myself; }