
org.bitbucket.cowwoc.requirements.guava.MultimapVerifier Maven / Gradle / Ivy
/*
* Copyright (c) 2014 Gili Tzabari
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
package org.bitbucket.cowwoc.requirements.guava;
import com.google.common.collect.Multimap;
import org.bitbucket.cowwoc.requirements.java.CollectionVerifier;
import org.bitbucket.cowwoc.requirements.java.SizeVerifier;
import org.bitbucket.cowwoc.requirements.java.extension.ExtensibleObjectVerifier;
import java.util.Collection;
import java.util.Map.Entry;
import java.util.Set;
import java.util.function.Consumer;
/**
* Verifies the requirements of a Multimap.
*
* @param the type of key in the multimap
* @param the type of value in the multimap
*/
public interface MultimapVerifier
extends ExtensibleObjectVerifier, Multimap>
{
/**
* @return a verifier over {@link Multimap#keySet()}
*/
CollectionVerifier, K> keySet();
/**
* Verifies nested requirements. This mechanism can be used to
*
* group related requirements.
*
* @param consumer verifies the {@link Multimap#keySet()}
* @return the updated verifier
*/
@SuppressWarnings("LongLine")
MultimapVerifier keySet(Consumer, K>> consumer);
/**
* @return a verifier over {@link Multimap#values()}
*/
CollectionVerifier, V> values();
/**
* Verifies nested requirements. This mechanism can be used to
*
* group related requirements.
*
* @param consumer verifies the {@link Multimap#values()}
* @return the updated verifier
*/
@SuppressWarnings("LongLine")
MultimapVerifier values(Consumer, V>> consumer);
/**
* @return a verifier over {@link Multimap#entries()}
*/
CollectionVerifier>, Entry> entries();
/**
* Verifies nested requirements. This mechanism can be used to
*
* group related requirements.
*
* @param consumer verifies the {@link Multimap#entries()}
* @return the updated verifier
*/
@SuppressWarnings("LongLine")
MultimapVerifier entries(Consumer>, Entry>> consumer);
/**
* Ensures that the actual value is empty.
*
* @return the updated verifier
* @throws IllegalArgumentException if actual value is not empty
*/
MultimapVerifier isEmpty();
/**
* Ensures that the actual value is not empty.
*
* @return the updated verifier
* @throws IllegalArgumentException if actual value is empty
*/
MultimapVerifier isNotEmpty();
/**
* @return a verifier over {@link Multimap#size()}
*/
SizeVerifier size();
/**
* Verifies nested requirements. This mechanism can be used to
*
* group related requirements.
*
* @param consumer verifies the multimap's size
* @return the updated verifier
*/
@SuppressWarnings("LongLine")
MultimapVerifier size(Consumer consumer);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy