/** * {@inheritDoc} * * <p>Because an inverse of a set multimap cannot contain multiple pairs with the same key and * value, this method returns an {@code ImmutableSetMultimap} rather than the {@code * ImmutableMultimap} specified in the {@code ImmutableMultimap} class. * * @since 11.0 */ public ImmutableSetMultimap<V, K> inverse() { ImmutableSetMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a set multimap cannot contain multiple pairs with the same key and * value, this method returns an {@code ImmutableSetMultimap} rather than the {@code * ImmutableMultimap} specified in the {@code ImmutableMultimap} class. * * @since 11.0 */ public ImmutableSetMultimap<V, K> inverse() { ImmutableSetMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * A builder for creating immutable {@code SetMultimap} instances, especially {@code public static * final} multimaps ("constant multimaps"). Example: * * <pre>{@code * static final Multimap<String, Integer> STRING_TO_INTEGER_MULTIMAP = * new ImmutableSetMultimap.Builder<String, Integer>() * .put("one", 1) * .putAll("several", 1, 2, 3) * .putAll("many", 1, 2, 3, 4, 5) * .build(); * }</pre> * * <p>Builder instances can be reused; it is safe to call {@link #build} multiple times to build * multiple multimaps in series. Each multimap contains the key-value mappings in the previously * created multimaps. * * @since 2.0 */ public static final class Builder<K, V> extends ImmutableMultimap.Builder<K, V> { /** * Creates a new builder. The returned builder is equivalent to the builder generated by {@link * ImmutableSetMultimap#builder}. */ public Builder() { super(); } @Override Collection<V> newMutableValueCollection() {
/** * {@inheritDoc} * * <p>Because an inverse of a set multimap cannot contain multiple pairs with the same key and * value, this method returns an {@code ImmutableSetMultimap} rather than the {@code * ImmutableMultimap} specified in the {@code ImmutableMultimap} class. * * @since 11.0 */ public ImmutableSetMultimap<V, K> inverse() { ImmutableSetMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a set multimap cannot contain multiple pairs with the same key and * value, this method returns an {@code ImmutableSetMultimap} rather than the {@code * ImmutableMultimap} specified in the {@code ImmutableMultimap} class. * * @since 11.0 */ public ImmutableSetMultimap<V, K> inverse() { ImmutableSetMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a set multimap cannot contain multiple pairs with * the same key and value, this method returns an {@code ImmutableSetMultimap} * rather than the {@code ImmutableMultimap} specified in the {@code * ImmutableMultimap} class. * * @since 11.0 */ public ImmutableSetMultimap<V, K> inverse() { ImmutableSetMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a set multimap cannot contain multiple pairs with * the same key and value, this method returns an {@code ImmutableSetMultimap} * rather than the {@code ImmutableMultimap} specified in the {@code * ImmutableMultimap} class. * * @since 11.0 */ public ImmutableSetMultimap<V, K> inverse() { ImmutableSetMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a set multimap cannot contain multiple pairs with * the same key and value, this method returns an {@code ImmutableSetMultimap} * rather than the {@code ImmutableMultimap} specified in the {@code * ImmutableMultimap} class. * * @since 11.0 */ public ImmutableSetMultimap<V, K> inverse() { ImmutableSetMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a set multimap cannot contain multiple pairs with * the same key and value, this method returns an {@code ImmutableSetMultimap} * rather than the {@code ImmutableMultimap} specified in the {@code * ImmutableMultimap} class. * * @since 11.0 */ public ImmutableSetMultimap<V, K> inverse() { ImmutableSetMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a set multimap cannot contain multiple pairs with * the same key and value, this method returns an {@code ImmutableSetMultimap} * rather than the {@code ImmutableMultimap} specified in the {@code * ImmutableMultimap} class. * * @since 11.0 */ public ImmutableSetMultimap<V, K> inverse() { ImmutableSetMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a set multimap cannot contain multiple pairs with * the same key and value, this method returns an {@code ImmutableSetMultimap} * rather than the {@code ImmutableMultimap} specified in the {@code * ImmutableMultimap} class. * * @since 11.0 */ public ImmutableSetMultimap<V, K> inverse() { ImmutableSetMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a set multimap cannot contain multiple pairs with * the same key and value, this method returns an {@code ImmutableSetMultimap} * rather than the {@code ImmutableMultimap} specified in the {@code * ImmutableMultimap} class. * * @since 11.0 */ public ImmutableSetMultimap<V, K> inverse() { ImmutableSetMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a set multimap cannot contain multiple pairs with * the same key and value, this method returns an {@code ImmutableSetMultimap} * rather than the {@code ImmutableMultimap} specified in the {@code * ImmutableMultimap} class. * * @since 11.0 */ public ImmutableSetMultimap<V, K> inverse() { ImmutableSetMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a set multimap cannot contain multiple pairs with the same key and * value, this method returns an {@code ImmutableSetMultimap} rather than the * {@code ImmutableMultimap} specified in the {@code ImmutableMultimap} class. * * @since 11 */ @Beta public ImmutableSetMultimap<V, K> inverse() { ImmutableSetMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }