/** * {@inheritDoc} * * <p>Because an inverse of a list multimap can contain multiple pairs with the same key and * value, this method returns an {@code ImmutableListMultimap} rather than the {@code * ImmutableMultimap} specified in the {@code ImmutableMultimap} class. * * @since 11.0 */ @Override public ImmutableListMultimap<V, K> inverse() { ImmutableListMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a list multimap can contain multiple pairs with the same key and * value, this method returns an {@code ImmutableListMultimap} rather than the {@code * ImmutableMultimap} specified in the {@code ImmutableMultimap} class. * * @since 11.0 */ @Override public ImmutableListMultimap<V, K> inverse() { ImmutableListMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * A builder for creating immutable {@code ListMultimap} instances, especially {@code public * static final} multimaps ("constant multimaps"). Example: * * <pre>{@code * static final Multimap<String, Integer> STRING_TO_INTEGER_MULTIMAP = * new ImmutableListMultimap.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 * ImmutableListMultimap#builder}. */ public Builder() {} @CanIgnoreReturnValue @Override public Builder<K, V> put(K key, V value) { super.put(key, value);
/** * {@inheritDoc} * * <p>Because an inverse of a list multimap can contain multiple pairs with * the same key and value, this method returns an {@code * ImmutableListMultimap} rather than the {@code ImmutableMultimap} specified * in the {@code ImmutableMultimap} class. * * @since 11.0 */ @Override public ImmutableListMultimap<V, K> inverse() { ImmutableListMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a list multimap can contain multiple pairs with the same key and * value, this method returns an {@code ImmutableListMultimap} rather than the {@code * ImmutableMultimap} specified in the {@code ImmutableMultimap} class. * * @since 11.0 */ @Override public ImmutableListMultimap<V, K> inverse() { ImmutableListMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a list multimap can contain multiple pairs with * the same key and value, this method returns an {@code * ImmutableListMultimap} rather than the {@code ImmutableMultimap} specified * in the {@code ImmutableMultimap} class. * * @since 11.0 */ @Override public ImmutableListMultimap<V, K> inverse() { ImmutableListMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a list multimap can contain multiple pairs with the same key and * value, this method returns an {@code ImmutableListMultimap} rather than the {@code * ImmutableMultimap} specified in the {@code ImmutableMultimap} class. * * @since 11.0 */ @Override public ImmutableListMultimap<V, K> inverse() { ImmutableListMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a list multimap can contain multiple pairs with * the same key and value, this method returns an {@code * ImmutableListMultimap} rather than the {@code ImmutableMultimap} specified * in the {@code ImmutableMultimap} class. * * @since 11.0 */ @Override public ImmutableListMultimap<V, K> inverse() { ImmutableListMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a list multimap can contain multiple pairs with * the same key and value, this method returns an {@code * ImmutableListMultimap} rather than the {@code ImmutableMultimap} specified * in the {@code ImmutableMultimap} class. * * @since 11.0 */ @Override public ImmutableListMultimap<V, K> inverse() { ImmutableListMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a list multimap can contain multiple pairs with * the same key and value, this method returns an {@code * ImmutableListMultimap} rather than the {@code ImmutableMultimap} specified * in the {@code ImmutableMultimap} class. * * @since 11.0 */ @Override public ImmutableListMultimap<V, K> inverse() { ImmutableListMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a list multimap can contain multiple pairs with * the same key and value, this method returns an {@code * ImmutableListMultimap} rather than the {@code ImmutableMultimap} specified * in the {@code ImmutableMultimap} class. * * @since 11.0 */ @Override public ImmutableListMultimap<V, K> inverse() { ImmutableListMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a list multimap can contain multiple pairs with * the same key and value, this method returns an {@code * ImmutableListMultimap} rather than the {@code ImmutableMultimap} specified * in the {@code ImmutableMultimap} class. * * @since 11.0 */ @Override public ImmutableListMultimap<V, K> inverse() { ImmutableListMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a list multimap can contain multiple pairs with * the same key and value, this method returns an {@code * ImmutableListMultimap} rather than the {@code ImmutableMultimap} specified * in the {@code ImmutableMultimap} class. * * @since 11.0 */ @Override public ImmutableListMultimap<V, K> inverse() { ImmutableListMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }
/** * {@inheritDoc} * * <p>Because an inverse of a list multimap can contain multiple pairs with the same key and * value, this method returns an {@code ImmutableListMultimap} rather than the * {@code ImmutableMultimap} specified in the {@code ImmutableMultimap} class. * * @since 11 */ @Beta public ImmutableListMultimap<V, K> inverse() { ImmutableListMultimap<V, K> result = inverse; return (result == null) ? (inverse = invert()) : result; }