org.hibernate.testing.hamcrest.CollectionMatchers Maven / Gradle / Ivy
                 Go to download
                
        
                    Show more of this group  Show more artifacts with this name
Show all versions of hibernate-testing Show documentation
                Show all versions of hibernate-testing Show documentation
Support for testing Hibernate ORM functionality
                
             The newest version!
        
        /*
 * SPDX-License-Identifier: Apache-2.0
 * Copyright Red Hat Inc. and Hibernate Authors
 */
package org.hibernate.testing.hamcrest;
import java.util.Collection;
import org.hamcrest.Matcher;
/**
 * @author Steve Ebersole
 */
public class CollectionMatchers {
	private static final CollectionEmptinessMatcher IS_EMPTY = new CollectionEmptinessMatcher( true );
	private static final CollectionEmptinessMatcher IS_NOT_EMPTY = new CollectionEmptinessMatcher( false );
	public static Matcher isEmpty() {
		return IS_EMPTY;
	}
	public static Matcher isNotEmpty() {
		return IS_NOT_EMPTY;
	}
	public static Matcher> hasSize(int size) {
		return org.hamcrest.Matchers.hasSize( size );
	}
	public static > HasNullElementsMatcher hasNullElements() {
		//noinspection unchecked
		return HasNullElementsMatcher.HAS_NULL_ELEMENTS_MATCHER;
	}
	public static > HasNullElementsMatcher hasNoNullElements() {
		//noinspection unchecked
		return HasNullElementsMatcher.HAS_NO_NULL_ELEMENTS_MATCHER;
	}
	public static > Matcher isInitialized() {
		return InitializationCheckMatcher.isInitialized();
	}
	public static > Matcher isNotInitialized() {
		return InitializationCheckMatcher.isNotInitialized();
	}
}
               © 2015 - 2025 Weber Informatics LLC | Privacy Policy