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

org.hibernate.testing.hamcrest.CollectionMatchers Maven / Gradle / Ivy

There is a newer version: 7.0.0.Beta2
Show newest version
/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later
 * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
 */
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 - 2024 Weber Informatics LLC | Privacy Policy