Merge pull request #6387 from joefarebrother/guava-cache

Java: Model guava cache package
This commit is contained in:
Joe Farebrother
2021-08-19 10:53:48 +01:00
committed by GitHub
38 changed files with 994 additions and 828 deletions

View File

@@ -0,0 +1,32 @@
/** Flow steps through methods of `com.google.common.cache` */
import java
private import semmle.code.java.dataflow.ExternalFlow
private class GuavaBaseCsv extends SummaryModelCsv {
override predicate row(string row) {
row =
[
//`namespace; type; subtypes; name; signature; ext; input; output; kind`
"com.google.common.cache;Cache;true;asMap;();;MapKey of Argument[-1];MapKey of ReturnValue;value",
"com.google.common.cache;Cache;true;asMap;();;MapValue of Argument[-1];MapValue of ReturnValue;value",
// lambda flow from Argument[1] not implemented
"com.google.common.cache;Cache;true;get;(Object,Callable);;MapValue of Argument[-1];ReturnValue;value",
"com.google.common.cache;Cache;true;getIfPresent;(Object);;MapValue of Argument[-1];ReturnValue;value",
// the true flow to MapKey of ReturnValue for getAllPresent is the intersection of the these inputs, but intersections cannot be modelled fully accurately.
"com.google.common.cache;Cache;true;getAllPresent;(Iterable);;MapKey of Argument[-1];MapKey of ReturnValue;value",
"com.google.common.cache;Cache;true;getAllPresent;(Iterable);;Element of Argument[0];MapKey of ReturnValue;value",
"com.google.common.cache;Cache;true;getAllPresent;(Iterable);;MapValue of Argument[-1];MapValue of ReturnValue;value",
"com.google.common.cache;Cache;true;put;(Object,Object);;Argument[0];MapKey of Argument[-1];value",
"com.google.common.cache;Cache;true;put;(Object,Object);;Argument[1];MapValue of Argument[-1];value",
"com.google.common.cache;Cache;true;putAll;(Map);;MapKey of Argument[0];MapKey of Argument[-1];value",
"com.google.common.cache;Cache;true;putAll;(Map);;MapValue of Argument[0];MapValue of Argument[-1];value",
"com.google.common.cache;LoadingCache;true;get;(Object);;MapValue of Argument[-1];ReturnValue;value",
"com.google.common.cache;LoadingCache;true;getUnchecked;(Object);;MapValue of Argument[-1];ReturnValue;value",
"com.google.common.cache;LoadingCache;true;apply;(Object);;MapValue of Argument[-1];ReturnValue;value",
"com.google.common.cache;LoadingCache;true;getAll;(Iterable);;Element of Argument[0];MapKey of ReturnValue;value",
"com.google.common.cache;LoadingCache;true;getAll;(Iterable);;Element of Argument[0];MapKey of Argument[-1];value",
"com.google.common.cache;LoadingCache;true;getAll;(Iterable);;MapValue of Argument[-1];MapValue of ReturnValue;value"
]
}
}

View File

@@ -6,3 +6,4 @@ import java
import Base
import Collections
import IO
import Cache

View File

@@ -0,0 +1,181 @@
package generatedtest;
import com.google.common.cache.Cache;
import com.google.common.cache.LoadingCache;
import com.google.common.cache.CacheBuilder;
import com.google.common.collect.ImmutableMap;
import java.util.Map;
import java.util.concurrent.ConcurrentMap;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;
// Test case generated by GenerateFlowTestCase.ql
public class Test {
<K,V> K getMapKey(Map<K,V> container) { return container.keySet().iterator().next(); }
<K,V> K getMapKey(Cache<K,V> container) { return getMapKey(container.asMap()); }
<K,V> V getMapValue(Map<K,V> container) { return container.values().iterator().next(); }
<K,V> V getMapValue(Cache<K,V> container) { return getMapValue(container.asMap()); }
<T> Iterable<T> newWithElement(T element) {
List<T> l = new ArrayList();
l.add(element);
return l;
}
<K,V> Map<K,V> newMapWithMapKey(K element) {
Map<K,V> m = new HashMap<K,V>();
m.put(element, null);
return m;
}
<K,V> LoadingCache<K,V> newCacheWithMapKey(K element) {
LoadingCache<K,V> lc = CacheBuilder.newBuilder().build(null);
lc.put(element, null);
return lc;
}
<K,V> Map<K,V> newMapWithMapValue(V element) {
Map<K,V> m = new HashMap<K,V>();
m.put(null, element);
return m;
}
<K,V> LoadingCache<K,V> newCacheWithMapValue(V element) {
LoadingCache<K,V> lc = CacheBuilder.newBuilder().build(null);
lc.put(null, element);
return lc;
}
<T> T source() { return null; }
void sink(Object o) { }
public void test() throws Exception {
{
// "com.google.common.cache;Cache;true;asMap;();;MapKey of Argument[-1];MapKey of ReturnValue;value"
ConcurrentMap out = null;
LoadingCache in = newCacheWithMapKey(source());
out = in.asMap();
sink(getMapKey(out)); // $ hasValueFlow
}
{
// "com.google.common.cache;Cache;true;asMap;();;MapKey of Argument[-1];MapKey of ReturnValue;value"
ConcurrentMap out = null;
Cache in = newCacheWithMapKey(source());
out = in.asMap();
sink(getMapKey(out)); // $ hasValueFlow
}
{
// "com.google.common.cache;Cache;true;asMap;();;MapValue of Argument[-1];MapValue of ReturnValue;value"
ConcurrentMap out = null;
LoadingCache in = newCacheWithMapValue(source());
out = in.asMap();
sink(getMapValue(out)); // $ hasValueFlow
}
{
// "com.google.common.cache;Cache;true;asMap;();;MapValue of Argument[-1];MapValue of ReturnValue;value"
ConcurrentMap out = null;
Cache in = newCacheWithMapValue(source());
out = in.asMap();
sink(getMapValue(out)); // $ hasValueFlow
}
{
// "com.google.common.cache;Cache;true;get;(Object,Callable);;MapValue of Argument[-1];ReturnValue;value"
Object out = null;
Cache in = newCacheWithMapValue(source());
out = in.get(null, null);
sink(out); // $ hasValueFlow
}
{
// "com.google.common.cache;Cache;true;getAllPresent;(Iterable);;Element of Argument[0];MapKey of ReturnValue;value"
ImmutableMap out = null;
Iterable in = newWithElement(source());
Cache instance = null;
out = instance.getAllPresent(in);
sink(getMapKey(out)); // $ hasValueFlow
}
{
// "com.google.common.cache;Cache;true;getAllPresent;(Iterable);;MapKey of Argument[-1];MapKey of ReturnValue;value"
ImmutableMap out = null;
Cache in = newCacheWithMapKey(source());
out = in.getAllPresent(null);
sink(getMapKey(out)); // $ hasValueFlow
}
{
// "com.google.common.cache;Cache;true;getIfPresent;;;MapValue of Argument[-1];ReturnValue;value"
Object out = null;
Cache in = newCacheWithMapValue(source());
out = in.getIfPresent(null);
sink(out); // $ hasValueFlow
}
{
// "com.google.common.cache;Cache;true;put;(Object,Object);;Argument[0];MapKey of Argument[-1];value"
Cache out = null;
Object in = source();
out.put(in, null);
sink(getMapKey(out)); // $ hasValueFlow
}
{
// "com.google.common.cache;Cache;true;put;(Object,Object);;Argument[1];MapValue of Argument[-1];value"
Cache out = null;
Object in = source();
out.put(null, in);
sink(getMapValue(out)); // $ hasValueFlow
}
{
// "com.google.common.cache;Cache;true;putAll;(Map);;MapKey of Argument[0];MapKey of Argument[-1];value"
Cache out = null;
Map in = newMapWithMapKey(source());
out.putAll(in);
sink(getMapKey(out)); // $ hasValueFlow
}
{
// "com.google.common.cache;Cache;true;putAll;(Map);;MapValue of Argument[0];MapValue of Argument[-1];value"
Cache out = null;
Map in = newMapWithMapValue(source());
out.putAll(in);
sink(getMapValue(out)); // $ hasValueFlow
}
{
// "com.google.common.cache;LoadingCache;true;apply;;;MapValue of Argument[-1];ReturnValue;value"
Object out = null;
LoadingCache in = newCacheWithMapValue(source());
out = in.apply(null);
sink(out); // $ hasValueFlow
}
{
// "com.google.common.cache;LoadingCache;true;get;;;MapValue of Argument[-1];ReturnValue;value"
Object out = null;
LoadingCache in = newCacheWithMapValue(source());
out = in.get(null);
sink(out); // $ hasValueFlow
}
{
// "com.google.common.cache;LoadingCache;true;getAll;(Iterable);;Element of Argument[0];MapKey of Argument[-1];value"
LoadingCache out = null;
Iterable in = (Iterable)newWithElement(source());
out.getAll(in);
sink(getMapKey(out)); // $ hasValueFlow
}
{
// "com.google.common.cache;LoadingCache;true;getAll;(Iterable);;Element of Argument[0];MapKey of ReturnValue;value"
ImmutableMap out = null;
Iterable in = (Iterable)newWithElement(source());
LoadingCache instance = null;
out = instance.getAll(in);
sink(getMapKey(out)); // $ hasValueFlow
}
{
// "com.google.common.cache;LoadingCache;true;getAll;(Iterable);;MapValue of Argument[-1];MapValue of ReturnValue;value"
ImmutableMap out = null;
LoadingCache in = newCacheWithMapValue(source());
out = in.getAll(null);
sink(getMapValue(out)); // $ hasValueFlow
}
{
// "com.google.common.cache;LoadingCache;true;getUnchecked;;;MapValue of Argument[-1];ReturnValue;value"
Object out = null;
LoadingCache in = newCacheWithMapValue(source());
out = in.getUnchecked(null);
sink(out); // $ hasValueFlow
}
}
}

View File

@@ -0,0 +1 @@
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../../stubs/guava-30.0

View File

@@ -0,0 +1,53 @@
import java
import semmle.code.java.dataflow.DataFlow
import semmle.code.java.dataflow.ExternalFlow
import semmle.code.java.dataflow.TaintTracking
import TestUtilities.InlineExpectationsTest
class ValueFlowConf extends DataFlow::Configuration {
ValueFlowConf() { this = "qltest:valueFlowConf" }
override predicate isSource(DataFlow::Node n) {
n.asExpr().(MethodAccess).getMethod().hasName("source")
}
override predicate isSink(DataFlow::Node n) {
n.asExpr().(Argument).getCall().getCallee().hasName("sink")
}
}
class TaintFlowConf extends TaintTracking::Configuration {
TaintFlowConf() { this = "qltest:taintFlowConf" }
override predicate isSource(DataFlow::Node n) {
n.asExpr().(MethodAccess).getMethod().hasName("source")
}
override predicate isSink(DataFlow::Node n) {
n.asExpr().(Argument).getCall().getCallee().hasName("sink")
}
}
class HasFlowTest extends InlineExpectationsTest {
HasFlowTest() { this = "HasFlowTest" }
override string getARelevantTag() { result = ["hasValueFlow", "hasTaintFlow"] }
override predicate hasActualResult(Location location, string element, string tag, string value) {
tag = "hasValueFlow" and
exists(DataFlow::Node src, DataFlow::Node sink, ValueFlowConf conf | conf.hasFlow(src, sink) |
sink.getLocation() = location and
element = sink.toString() and
value = ""
)
or
tag = "hasTaintFlow" and
exists(DataFlow::Node src, DataFlow::Node sink, TaintFlowConf conf |
conf.hasFlow(src, sink) and not any(ValueFlowConf c).hasFlow(src, sink)
|
sink.getLocation() = location and
element = sink.toString() and
value = ""
)
}
}

View File

@@ -1,25 +1,9 @@
/*
* Copyright (C) 2007 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
// Generated automatically from com.google.common.base.Function for testing purposes, and adjusted manually
package com.google.common.base;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface Function<F, T> extends java.util.function.Function<F, T> {
@Override
T apply(@Nullable F input);
@Override
boolean equals(@Nullable Object object);
public interface Function<F, T> extends java.util.function.Function<F, T>
{
T apply(F p0);
boolean equals(Object p0);
}

View File

@@ -1,29 +1,10 @@
/*
* Copyright (C) 2007 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
// Generated automatically from com.google.common.base.Predicate for testing purposes, and adjusted manually.
package com.google.common.base;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface Predicate<T> extends java.util.function.Predicate<T> {
boolean apply(@Nullable T input);
@Override
boolean equals(@Nullable Object object);
@Override
default boolean test(@Nullable T input) {
return false;
}
public interface Predicate<T> extends java.util.function.Predicate<T>
{
boolean apply(T p0);
boolean equals(Object p0);
default boolean test(T p0){ return false; }
}

View File

@@ -1,21 +1,8 @@
/*
* Copyright (C) 2007 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
// Generated automatically from com.google.common.base.Supplier for testing purposes, and adjusted manually
package com.google.common.base;
public interface Supplier<T> extends java.util.function.Supplier<T> {
@Override
T get();
public interface Supplier<T> extends java.util.function.Supplier<T>
{
T get();
}

View File

@@ -0,0 +1,11 @@
// Generated automatically from com.google.common.base.Ticker for testing purposes
package com.google.common.base;
abstract public class Ticker
{
protected Ticker(){}
public abstract long read();
public static Ticker systemTicker(){ return null; }
}

View File

@@ -0,0 +1,35 @@
// Generated automatically from com.google.common.cache.AbstractCache for testing purposes
package com.google.common.cache;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheStats;
import com.google.common.collect.ImmutableMap;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentMap;
abstract public class AbstractCache<K, V> implements Cache<K, V>
{
protected AbstractCache(){}
public CacheStats stats(){ return null; }
public ConcurrentMap<K, V> asMap(){ return null; }
public ImmutableMap<K, V> getAllPresent(Iterable<? extends Object> p0){ return null; }
public V get(K p0, Callable<? extends V> p1){ return null; }
public long size(){ return 0; }
public void cleanUp(){}
public void invalidate(Object p0){}
public void invalidateAll(){}
public void invalidateAll(Iterable<? extends Object> p0){}
public void put(K p0, V p1){}
public void putAll(Map<? extends K, ? extends V> p0){}
static public interface StatsCounter
{
CacheStats snapshot();
void recordEviction();
void recordHits(int p0);
void recordLoadException(long p0);
void recordLoadSuccess(long p0);
void recordMisses(int p0);
}
}

View File

@@ -0,0 +1,25 @@
// Generated automatically from com.google.common.cache.Cache for testing purposes
package com.google.common.cache;
import com.google.common.cache.CacheStats;
import com.google.common.collect.ImmutableMap;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentMap;
public interface Cache<K, V>
{
CacheStats stats();
ConcurrentMap<K, V> asMap();
ImmutableMap<K, V> getAllPresent(Iterable<? extends Object> p0);
V get(K p0, Callable<? extends V> p1);
V getIfPresent(Object p0);
long size();
void cleanUp();
void invalidate(Object p0);
void invalidateAll();
void invalidateAll(Iterable<? extends Object> p0);
void put(K p0, V p1);
void putAll(Map<? extends K, ? extends V> p0);
}

View File

@@ -0,0 +1,41 @@
// Generated automatically from com.google.common.cache.CacheBuilder for testing purposes
package com.google.common.cache;
import com.google.common.base.Ticker;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilderSpec;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.cache.RemovalListener;
import com.google.common.cache.Weigher;
import java.time.Duration;
import java.util.concurrent.TimeUnit;
public class CacheBuilder<K, V>
{
protected CacheBuilder() {}
public <K1 extends K, V1 extends V> Cache<K1, V1> build(){ return null; }
public <K1 extends K, V1 extends V> CacheBuilder<K1, V1> removalListener(RemovalListener<? super K1, ? super V1> p0){ return null; }
public <K1 extends K, V1 extends V> CacheBuilder<K1, V1> weigher(Weigher<? super K1, ? super V1> p0){ return null; }
public <K1 extends K, V1 extends V> LoadingCache<K1, V1> build(CacheLoader<? super K1, V1> p0){ return null; }
public CacheBuilder<K, V> concurrencyLevel(int p0){ return null; }
public CacheBuilder<K, V> expireAfterAccess(Duration p0){ return null; }
public CacheBuilder<K, V> expireAfterAccess(long p0, TimeUnit p1){ return null; }
public CacheBuilder<K, V> expireAfterWrite(Duration p0){ return null; }
public CacheBuilder<K, V> expireAfterWrite(long p0, TimeUnit p1){ return null; }
public CacheBuilder<K, V> initialCapacity(int p0){ return null; }
public CacheBuilder<K, V> maximumSize(long p0){ return null; }
public CacheBuilder<K, V> maximumWeight(long p0){ return null; }
public CacheBuilder<K, V> recordStats(){ return null; }
public CacheBuilder<K, V> refreshAfterWrite(Duration p0){ return null; }
public CacheBuilder<K, V> refreshAfterWrite(long p0, TimeUnit p1){ return null; }
public CacheBuilder<K, V> softValues(){ return null; }
public CacheBuilder<K, V> ticker(Ticker p0){ return null; }
public CacheBuilder<K, V> weakKeys(){ return null; }
public CacheBuilder<K, V> weakValues(){ return null; }
public String toString(){ return null; }
public static CacheBuilder<Object, Object> from(CacheBuilderSpec p0){ return null; }
public static CacheBuilder<Object, Object> from(String p0){ return null; }
public static CacheBuilder<Object, Object> newBuilder(){ return null; }
}

View File

@@ -0,0 +1,15 @@
// Generated automatically from com.google.common.cache.CacheBuilderSpec for testing purposes
package com.google.common.cache;
public class CacheBuilderSpec
{
protected CacheBuilderSpec() {}
public String toParsableString(){ return null; }
public String toString(){ return null; }
public boolean equals(Object p0){ return false; }
public int hashCode(){ return 0; }
public static CacheBuilderSpec disableCaching(){ return null; }
public static CacheBuilderSpec parse(String p0){ return null; }
}

View File

@@ -0,0 +1,20 @@
// Generated automatically from com.google.common.cache.CacheLoader for testing purposes
package com.google.common.cache;
import com.google.common.base.Function;
import com.google.common.base.Supplier;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.Map;
import java.util.concurrent.Executor;
abstract public class CacheLoader<K, V>
{
protected CacheLoader(){}
public ListenableFuture<V> reload(K p0, V p1){ return null; }
public Map<K, V> loadAll(Iterable<? extends K> p0){ return null; }
public abstract V load(K p0);
public static <K, V> CacheLoader<K, V> asyncReloading(CacheLoader<K, V> p0, Executor p1){ return null; }
public static <K, V> CacheLoader<K, V> from(Function<K, V> p0){ return null; }
public static <V> CacheLoader<Object, V> from(Supplier<V> p0){ return null; }
}

View File

@@ -0,0 +1,27 @@
// Generated automatically from com.google.common.cache.CacheStats for testing purposes
package com.google.common.cache;
public class CacheStats
{
protected CacheStats() {}
public CacheStats minus(CacheStats p0){ return null; }
public CacheStats plus(CacheStats p0){ return null; }
public CacheStats(long p0, long p1, long p2, long p3, long p4, long p5){}
public String toString(){ return null; }
public boolean equals(Object p0){ return false; }
public double averageLoadPenalty(){ return 0; }
public double hitRate(){ return 0; }
public double loadExceptionRate(){ return 0; }
public double missRate(){ return 0; }
public int hashCode(){ return 0; }
public long evictionCount(){ return 0; }
public long hitCount(){ return 0; }
public long loadCount(){ return 0; }
public long loadExceptionCount(){ return 0; }
public long loadSuccessCount(){ return 0; }
public long missCount(){ return 0; }
public long requestCount(){ return 0; }
public long totalLoadTime(){ return 0; }
}

View File

@@ -0,0 +1,18 @@
// Generated automatically from com.google.common.cache.LoadingCache for testing purposes
package com.google.common.cache;
import com.google.common.base.Function;
import com.google.common.cache.Cache;
import com.google.common.collect.ImmutableMap;
import java.util.concurrent.ConcurrentMap;
public interface LoadingCache<K, V> extends Cache<K, V>, Function<K, V>
{
ConcurrentMap<K, V> asMap();
ImmutableMap<K, V> getAll(Iterable<? extends K> p0);
V apply(K p0);
V get(K p0);
V getUnchecked(K p0);
void refresh(K p0);
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from com.google.common.cache.RemovalCause for testing purposes, and adjusted manually
package com.google.common.cache;
public enum RemovalCause
{
COLLECTED, EXPIRED, EXPLICIT, REPLACED, SIZE;
private RemovalCause() {}
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from com.google.common.cache.RemovalListener for testing purposes
package com.google.common.cache;
import com.google.common.cache.RemovalNotification;
public interface RemovalListener<K, V>
{
void onRemoval(RemovalNotification<K, V> p0);
}

View File

@@ -0,0 +1,14 @@
// Generated automatically from com.google.common.cache.RemovalNotification for testing purposes, and adjusted manually
package com.google.common.cache;
import com.google.common.cache.RemovalCause;
import java.util.AbstractMap;
public class RemovalNotification<K, V> extends AbstractMap.SimpleImmutableEntry<K, V>
{
protected RemovalNotification(K k, V v) { super(k,v); }
public RemovalCause getCause(){ return null; }
public boolean wasEvicted(){ return false; }
public static <K, V> RemovalNotification<K, V> create(K p0, V p1, RemovalCause p2){ return null; }
}

View File

@@ -0,0 +1,9 @@
// Generated automatically from com.google.common.cache.Weigher for testing purposes
package com.google.common.cache;
public interface Weigher<K, V>
{
int weigh(K p0, V p1);
}

View File

@@ -1,90 +1,29 @@
/*
* Copyright (C) 2012 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated automatically from com.google.common.collect.AbstractMultimap for testing purposes
package com.google.common.collect;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multiset;
import java.util.Collection;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
abstract class AbstractMultimap<K, V> implements Multimap<K, V> {
@Override
public boolean isEmpty() {
return false;
}
@Override
public boolean containsValue(Object value) {
return false;
}
@Override
public boolean containsEntry(Object key, Object value) {
return false;
}
@Override
public boolean remove(Object key, Object value) {
return false;
}
@Override
public boolean put(K key, V value) {
return false;
}
@Override
public boolean putAll(K key, Iterable<? extends V> values) {
return false;
}
@Override
public boolean putAll(Multimap<? extends K, ? extends V> multimap) {
return false;
}
@Override
public Collection<V> replaceValues(K key, Iterable<? extends V> values) {
return null;
}
@Override
public Collection<Entry<K, V>> entries() {
return null;
}
@Override
public Set<K> keySet() {
return null;
}
@Override
public Multiset<K> keys() {
return null;
}
@Override
public Collection<V> values() {
return null;
}
@Override
public Map<K, Collection<V>> asMap() {
return null;
}
abstract class AbstractMultimap<K, V> implements Multimap<K, V>
{
public Collection<Map.Entry<K, V>> entries(){ return null; }
public Collection<V> replaceValues(K p0, Iterable<? extends V> p1){ return null; }
public Collection<V> values(){ return null; }
public Map<K, Collection<V>> asMap(){ return null; }
public Multiset<K> keys(){ return null; }
public Set<K> keySet(){ return null; }
public String toString(){ return null; }
public boolean containsEntry(Object p0, Object p1){ return false; }
public boolean containsValue(Object p0){ return false; }
public boolean equals(Object p0){ return false; }
public boolean isEmpty(){ return false; }
public boolean put(K p0, V p1){ return false; }
public boolean putAll(K p0, Iterable<? extends V> p1){ return false; }
public boolean putAll(Multimap<? extends K, ? extends V> p0){ return false; }
public boolean remove(Object p0, Object p1){ return false; }
public int hashCode(){ return 0; }
}

View File

@@ -0,0 +1,9 @@
// Generated automatically from com.google.common.collect.BaseImmutableMultimap for testing purposes
package com.google.common.collect;
import com.google.common.collect.AbstractMultimap;
abstract class BaseImmutableMultimap<K, V> extends AbstractMultimap<K, V>
{
}

View File

@@ -1,50 +1,37 @@
/*
* Copyright (C) 2008 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated automatically from com.google.common.collect.ImmutableCollection for testing purposes
package com.google.common.collect;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.UnmodifiableIterator;
import java.io.Serializable;
import java.util.AbstractCollection;
import java.util.Collection;
import java.util.Iterator;
import java.util.Spliterator;
import java.util.function.Predicate;
public abstract class ImmutableCollection<E> extends AbstractCollection<E> implements Serializable {
ImmutableCollection() {}
public ImmutableList<E> asList() {
return null;
}
public abstract static class Builder<E> {
Builder() {}
public abstract Builder<E> add(E element);
public Builder<E> add(E... elements) {
return null;
abstract public class ImmutableCollection<E> extends AbstractCollection<E> implements Serializable
{
abstract static public class Builder<E>
{
public ImmutableCollection.Builder<E> add(E... p0){ return null; }
public ImmutableCollection.Builder<E> addAll(Iterable<? extends E> p0){ return null; }
public ImmutableCollection.Builder<E> addAll(Iterator<? extends E> p0){ return null; }
public abstract ImmutableCollection.Builder<E> add(E p0);
public abstract ImmutableCollection<E> build();
}
public Builder<E> addAll(Iterable<? extends E> elements) {
return null;
}
public Builder<E> addAll(Iterator<? extends E> elements) {
return null;
}
public abstract ImmutableCollection<E> build();
}
public ImmutableList<E> asList(){ return null; }
public Spliterator<E> spliterator(){ return null; }
public abstract UnmodifiableIterator<E> iterator();
public abstract boolean contains(Object p0);
public final <T> T[] toArray(T[] p0){ return null; }
public final Object[] toArray(){ return null; }
public final boolean add(E p0){ return false; }
public final boolean addAll(Collection<? extends E> p0){ return false; }
public final boolean remove(Object p0){ return false; }
public final boolean removeAll(Collection<? extends Object> p0){ return false; }
public final boolean removeIf(Predicate<? super E> p0){ return false; }
public final boolean retainAll(Collection<? extends Object> p0){ return false; }
public final void clear(){}
}

View File

@@ -1,101 +1,70 @@
/*
* Copyright (C) 2007 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated automatically from com.google.common.collect.ImmutableList for testing purposes
package com.google.common.collect;
import java.util.Arrays;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.UnmodifiableIterator;
import com.google.common.collect.UnmodifiableListIterator;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.RandomAccess;
import java.util.Spliterator;
import java.util.function.Consumer;
import java.util.function.UnaryOperator;
import java.util.stream.Collector;
public abstract class ImmutableList<E> extends ImmutableCollection<E>
implements List<E>{
public static <E> ImmutableList<E> of() {
return null;
}
public static <E> ImmutableList<E> of(E element) {
return null;
}
public static <E> ImmutableList<E> of(E e1, E e2) {
return null;
}
public static <E> ImmutableList<E> of(E e1, E e2, E e3) {
return null;
}
public static <E> ImmutableList<E> of(E e1, E e2, E e3, E e4) {
return null;
}
public static <E> ImmutableList<E> of(
E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10, E e11, E e12, E... others) {
return null;
}
public static <E> ImmutableList<E> copyOf(Iterable<? extends E> elements) {
return null;
}
public static <E> ImmutableList<E> copyOf(Collection<? extends E> elements) {
return null;
}
public static <E> ImmutableList<E> copyOf(Iterator<? extends E> elements) {
return null;
}
public static <E> ImmutableList<E> copyOf(E[] elements) {
return null;
}
public static <E extends Comparable<? super E>> ImmutableList<E> sortedCopyOf(
Iterable<? extends E> elements) {
return null;
}
public static <E> ImmutableList<E> sortedCopyOf(
Comparator<? super E> comparator, Iterable<? extends E> elements) {
return null;
}
ImmutableList() {}
public ImmutableList<E> reverse() {
return null;
}
public static <E> Builder<E> builder() {
return null;
}
public static final class Builder<E> extends ImmutableCollection.Builder<E> {
@Override
public Builder<E> add(E element) {
return null;
abstract public class ImmutableList<E> extends ImmutableCollection<E> implements List<E>, RandomAccess
{
public ImmutableList<E> reverse(){ return null; }
public ImmutableList<E> subList(int p0, int p1){ return null; }
public Spliterator<E> spliterator(){ return null; }
public UnmodifiableIterator<E> iterator(){ return null; }
public UnmodifiableListIterator<E> listIterator(){ return null; }
public UnmodifiableListIterator<E> listIterator(int p0){ return null; }
public boolean contains(Object p0){ return false; }
public boolean equals(Object p0){ return false; }
public final E remove(int p0){ return null; }
public final E set(int p0, E p1){ return null; }
public final ImmutableList<E> asList(){ return null; }
public final boolean addAll(int p0, Collection<? extends E> p1){ return false; }
public final void add(int p0, E p1){}
public final void replaceAll(UnaryOperator<E> p0){}
public final void sort(Comparator<? super E> p0){}
public int hashCode(){ return 0; }
public int indexOf(Object p0){ return 0; }
public int lastIndexOf(Object p0){ return 0; }
public static <E extends Comparable<? super E>> ImmutableList<E> sortedCopyOf(Iterable<? extends E> p0){ return null; }
public static <E> Collector<E, ? extends Object, ImmutableList<E>> toImmutableList(){ return null; }
public static <E> ImmutableList.Builder<E> builder(){ return null; }
public static <E> ImmutableList.Builder<E> builderWithExpectedSize(int p0){ return null; }
public static <E> ImmutableList<E> copyOf(Collection<? extends E> p0){ return null; }
public static <E> ImmutableList<E> copyOf(E[] p0){ return null; }
public static <E> ImmutableList<E> copyOf(Iterable<? extends E> p0){ return null; }
public static <E> ImmutableList<E> copyOf(Iterator<? extends E> p0){ return null; }
public static <E> ImmutableList<E> of(){ return null; }
public static <E> ImmutableList<E> of(E p0){ return null; }
public static <E> ImmutableList<E> of(E p0, E p1){ return null; }
public static <E> ImmutableList<E> of(E p0, E p1, E p2){ return null; }
public static <E> ImmutableList<E> of(E p0, E p1, E p2, E p3){ return null; }
public static <E> ImmutableList<E> of(E p0, E p1, E p2, E p3, E p4){ return null; }
public static <E> ImmutableList<E> of(E p0, E p1, E p2, E p3, E p4, E p5){ return null; }
public static <E> ImmutableList<E> of(E p0, E p1, E p2, E p3, E p4, E p5, E p6){ return null; }
public static <E> ImmutableList<E> of(E p0, E p1, E p2, E p3, E p4, E p5, E p6, E p7){ return null; }
public static <E> ImmutableList<E> of(E p0, E p1, E p2, E p3, E p4, E p5, E p6, E p7, E p8){ return null; }
public static <E> ImmutableList<E> of(E p0, E p1, E p2, E p3, E p4, E p5, E p6, E p7, E p8, E p9){ return null; }
public static <E> ImmutableList<E> of(E p0, E p1, E p2, E p3, E p4, E p5, E p6, E p7, E p8, E p9, E p10){ return null; }
public static <E> ImmutableList<E> of(E p0, E p1, E p2, E p3, E p4, E p5, E p6, E p7, E p8, E p9, E p10, E p11, E... p12){ return null; }
public static <E> ImmutableList<E> sortedCopyOf(Comparator<? super E> p0, Iterable<? extends E> p1){ return null; }
public void forEach(Consumer<? super E> p0){}
static public class Builder<E> extends ImmutableCollection.Builder<E>
{
public Builder(){}
public ImmutableList.Builder<E> add(E p0){ return null; }
public ImmutableList.Builder<E> add(E... p0){ return null; }
public ImmutableList.Builder<E> addAll(Iterable<? extends E> p0){ return null; }
public ImmutableList.Builder<E> addAll(Iterator<? extends E> p0){ return null; }
public ImmutableList<E> build(){ return null; }
}
@Override
public ImmutableList<E> build() {
return null;
}
}
}

View File

@@ -1,149 +1,65 @@
/*
* Copyright (C) 2008 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated automatically from com.google.common.collect.ImmutableMap for testing purposes
package com.google.common.collect;
import java.util.Collection;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSetMultimap;
import java.io.Serializable;
import java.util.Comparator;
import java.util.Map;
import java.util.function.BiFunction;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.stream.Collector;
public abstract class ImmutableMap<K, V> implements Map<K, V> {
public static <K, V> ImmutableMap<K, V> of() {
return null;
}
public static <K, V> ImmutableMap<K, V> of(K k1, V v1) {
return null;
}
public static <K, V> ImmutableMap<K, V> of(K k1, V v1, K k2, V v2) {
return null;
}
public static <K, V> ImmutableMap<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3) {
return null;
}
public static <K, V> ImmutableMap<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) {
return null;
}
public static <K, V> ImmutableMap<K, V> of(
K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) {
return null;
}
public static <K, V> Builder<K, V> builder() {
return null;
}
public static <K, V> Builder<K, V> builderWithExpectedSize(int expectedSize) {
return null;
}
public static class Builder<K, V> {
public Builder() {
abstract public class ImmutableMap<K, V> implements Map<K, V>, Serializable
{
public ImmutableCollection<V> values(){ return null; }
public ImmutableSet<K> keySet(){ return null; }
public ImmutableSet<Map.Entry<K, V>> entrySet(){ return null; }
public ImmutableSetMultimap<K, V> asMultimap(){ return null; }
public String toString(){ return null; }
public abstract V get(Object p0);
public boolean containsKey(Object p0){ return false; }
public boolean containsValue(Object p0){ return false; }
public boolean equals(Object p0){ return false; }
public boolean isEmpty(){ return false; }
public final V compute(K p0, BiFunction<? super K, ? super V, ? extends V> p1){ return null; }
public final V computeIfAbsent(K p0, Function<? super K, ? extends V> p1){ return null; }
public final V computeIfPresent(K p0, BiFunction<? super K, ? super V, ? extends V> p1){ return null; }
public final V getOrDefault(Object p0, V p1){ return null; }
public final V merge(K p0, V p1, BiFunction<? super V, ? super V, ? extends V> p2){ return null; }
public final V put(K p0, V p1){ return null; }
public final V putIfAbsent(K p0, V p1){ return null; }
public final V remove(Object p0){ return null; }
public final V replace(K p0, V p1){ return null; }
public final boolean remove(Object p0, Object p1){ return false; }
public final boolean replace(K p0, V p1, V p2){ return false; }
public final void clear(){}
public final void putAll(Map<? extends K, ? extends V> p0){}
public final void replaceAll(BiFunction<? super K, ? super V, ? extends V> p0){}
public int hashCode(){ return 0; }
public static <K, V> ImmutableMap.Builder<K, V> builder(){ return null; }
public static <K, V> ImmutableMap.Builder<K, V> builderWithExpectedSize(int p0){ return null; }
public static <K, V> ImmutableMap<K, V> copyOf(Iterable<? extends Map.Entry<? extends K, ? extends V>> p0){ return null; }
public static <K, V> ImmutableMap<K, V> copyOf(Map<? extends K, ? extends V> p0){ return null; }
public static <K, V> ImmutableMap<K, V> of(){ return null; }
public static <K, V> ImmutableMap<K, V> of(K p0, V p1){ return null; }
public static <K, V> ImmutableMap<K, V> of(K p0, V p1, K p2, V p3){ return null; }
public static <K, V> ImmutableMap<K, V> of(K p0, V p1, K p2, V p3, K p4, V p5){ return null; }
public static <K, V> ImmutableMap<K, V> of(K p0, V p1, K p2, V p3, K p4, V p5, K p6, V p7){ return null; }
public static <K, V> ImmutableMap<K, V> of(K p0, V p1, K p2, V p3, K p4, V p5, K p6, V p7, K p8, V p9){ return null; }
public static <T, K, V> Collector<T, ? extends Object, ImmutableMap<K, V>> toImmutableMap(Function<? super T, ? extends K> p0, Function<? super T, ? extends V> p1){ return null; }
public static <T, K, V> Collector<T, ? extends Object, ImmutableMap<K, V>> toImmutableMap(Function<? super T, ? extends K> p0, Function<? super T, ? extends V> p1, BinaryOperator<V> p2){ return null; }
static public class Builder<K, V>
{
public Builder(){}
public ImmutableMap.Builder<K, V> orderEntriesByValue(Comparator<? super V> p0){ return null; }
public ImmutableMap.Builder<K, V> put(K p0, V p1){ return null; }
public ImmutableMap.Builder<K, V> put(Map.Entry<? extends K, ? extends V> p0){ return null; }
public ImmutableMap.Builder<K, V> putAll(Iterable<? extends Map.Entry<? extends K, ? extends V>> p0){ return null; }
public ImmutableMap.Builder<K, V> putAll(Map<? extends K, ? extends V> p0){ return null; }
public ImmutableMap<K, V> build(){ return null; }
}
public Builder<K, V> put(K key, V value) {
return null;
}
public Builder<K, V> put(Entry<? extends K, ? extends V> entry) {
return null;
}
public Builder<K, V> putAll(Map<? extends K, ? extends V> map) {
return null;
}
public Builder<K, V> putAll(Iterable<? extends Entry<? extends K, ? extends V>> entries) {
return null;
}
public Builder<K, V> orderEntriesByValue(Comparator<? super V> valueComparator) {
return null;
}
public ImmutableMap<K, V> build() {
return null;
}
}
public static <K, V> ImmutableMap<K, V> copyOf(Map<? extends K, ? extends V> map) {
return null;
}
public static <K, V> ImmutableMap<K, V> copyOf(
Iterable<? extends Entry<? extends K, ? extends V>> entries) {
return null;
}
@Override
public final V put(K k, V v) {
return null;
}
@Override
public final void putAll(Map<? extends K, ? extends V> map) {
}
@Override
public final V remove(Object o) {
return null;
}
@Override
public final void clear() {
}
@Override
public boolean isEmpty() {
return false;
}
@Override
public boolean containsKey(Object key) {
return false;
}
@Override
public boolean containsValue(Object value) {
return false;
}
@Override
public abstract V get(Object key);
@Override
public ImmutableSet<Entry<K, V>> entrySet() {
return null;
}
@Override
public ImmutableSet<K> keySet() {
return null;
}
@Override
public ImmutableCollection<V> values() {
return null;
}
// public ImmutableSetMultimap<K, V> asMultimap() {
// return null;
// }
}

View File

@@ -1,128 +1,60 @@
/*
* Copyright (C) 2008 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated automatically from com.google.common.collect.ImmutableMultimap for testing purposes
package com.google.common.collect;
import com.google.common.collect.BaseImmutableMultimap;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMultiset;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Multimap;
import java.io.Serializable;
import java.util.Collection;
import java.util.Comparator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.function.BiConsumer;
public abstract class ImmutableMultimap<K, V> extends AbstractMultimap<K, V> {
public static <K, V> ImmutableMultimap<K, V> of() {
return null;
}
public static <K, V> ImmutableMultimap<K, V> of(K k1, V v1) {
return null;
}
public static <K, V> ImmutableMultimap<K, V> of(K k1, V v1, K k2, V v2) {
return null;
}
public static <K, V> ImmutableMultimap<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3) {
return null;
}
public static <K, V> ImmutableMultimap<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) {
return null;
}
public static <K, V> ImmutableMultimap<K, V> of(
K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) {
return null;
}
public static <K, V> Builder<K, V> builder() {
return null;
}
public static class Builder<K, V> {
public Builder() {
abstract public class ImmutableMultimap<K, V> extends BaseImmutableMultimap<K, V> implements Serializable
{
protected ImmutableMultimap() {}
public ImmutableCollection<Map.Entry<K, V>> entries(){ return null; }
public ImmutableCollection<V> removeAll(Object p0){ return null; }
public ImmutableCollection<V> replaceValues(K p0, Iterable<? extends V> p1){ return null; }
public ImmutableCollection<V> values(){ return null; }
public ImmutableMap<K, Collection<V>> asMap(){ return null; }
public ImmutableMultiset<K> keys(){ return null; }
public ImmutableSet<K> keySet(){ return null; }
public abstract ImmutableCollection<V> get(K p0);
public abstract ImmutableMultimap<V, K> inverse();
public boolean containsKey(Object p0){ return false; }
public boolean containsValue(Object p0){ return false; }
public boolean put(K p0, V p1){ return false; }
public boolean putAll(K p0, Iterable<? extends V> p1){ return false; }
public boolean putAll(Multimap<? extends K, ? extends V> p0){ return false; }
public boolean remove(Object p0, Object p1){ return false; }
public int size(){ return 0; }
public static <K, V> ImmutableMultimap.Builder<K, V> builder(){ return null; }
public static <K, V> ImmutableMultimap<K, V> copyOf(Iterable<? extends Map.Entry<? extends K, ? extends V>> p0){ return null; }
public static <K, V> ImmutableMultimap<K, V> copyOf(Multimap<? extends K, ? extends V> p0){ return null; }
public static <K, V> ImmutableMultimap<K, V> of(){ return null; }
public static <K, V> ImmutableMultimap<K, V> of(K p0, V p1){ return null; }
public static <K, V> ImmutableMultimap<K, V> of(K p0, V p1, K p2, V p3){ return null; }
public static <K, V> ImmutableMultimap<K, V> of(K p0, V p1, K p2, V p3, K p4, V p5){ return null; }
public static <K, V> ImmutableMultimap<K, V> of(K p0, V p1, K p2, V p3, K p4, V p5, K p6, V p7){ return null; }
public static <K, V> ImmutableMultimap<K, V> of(K p0, V p1, K p2, V p3, K p4, V p5, K p6, V p7, K p8, V p9){ return null; }
public void clear(){}
public void forEach(BiConsumer<? super K, ? super V> p0){}
static public class Builder<K, V>
{
public Builder(){}
public ImmutableMultimap.Builder<K, V> orderKeysBy(Comparator<? super K> p0){ return null; }
public ImmutableMultimap.Builder<K, V> orderValuesBy(Comparator<? super V> p0){ return null; }
public ImmutableMultimap.Builder<K, V> put(K p0, V p1){ return null; }
public ImmutableMultimap.Builder<K, V> put(Map.Entry<? extends K, ? extends V> p0){ return null; }
public ImmutableMultimap.Builder<K, V> putAll(Iterable<? extends Map.Entry<? extends K, ? extends V>> p0){ return null; }
public ImmutableMultimap.Builder<K, V> putAll(K p0, Iterable<? extends V> p1){ return null; }
public ImmutableMultimap.Builder<K, V> putAll(K p0, V... p1){ return null; }
public ImmutableMultimap.Builder<K, V> putAll(Multimap<? extends K, ? extends V> p0){ return null; }
public ImmutableMultimap<K, V> build(){ return null; }
}
public Builder<K, V> put(K key, V value) {
return null;
}
public Builder<K, V> put(Entry<? extends K, ? extends V> entry) {
return null;
}
public Builder<K, V> putAll(Iterable<? extends Entry<? extends K, ? extends V>> entries) {
return null;
}
public Builder<K, V> putAll(K key, Iterable<? extends V> values) {
return null;
}
public Builder<K, V> putAll(K key, V... values) {
return null;
}
public Builder<K, V> putAll(Multimap<? extends K, ? extends V> multimap) {
return null;
}
public Builder<K, V> orderKeysBy(Comparator<? super K> keyComparator) {
return null;
}
public Builder<K, V> orderValuesBy(Comparator<? super V> valueComparator) {
return null;
}
public ImmutableMultimap<K, V> build() {
return null;
}
}
public static <K, V> ImmutableMultimap<K, V> copyOf(Multimap<? extends K, ? extends V> multimap) {
return null;
}
public static <K, V> ImmutableMultimap<K, V> copyOf(
Iterable<? extends Entry<? extends K, ? extends V>> entries) {
return null;
}
@Override
public ImmutableCollection<V> removeAll(Object key) {
return null;
}
@Override
public void clear() {
}
@Override
public abstract ImmutableCollection<V> get(K key);
public abstract ImmutableMultimap<V, K> inverse();
@Override
public boolean containsKey(Object key) {
return false;
}
@Override
public int size() {
return 0;
}
}

View File

@@ -1,125 +1,54 @@
/*
* Copyright (C) 2008 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated automatically from com.google.common.collect.ImmutableMultiset for testing purposes
package com.google.common.collect;
import java.util.Collection;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMultisetGwtSerializationDependencies;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Multiset;
import com.google.common.collect.UnmodifiableIterator;
import java.util.Iterator;
import java.util.function.Function;
import java.util.function.ToIntFunction;
import java.util.stream.Collector;
public abstract class ImmutableMultiset<E> extends ImmutableCollection<E>
implements Multiset<E> {
public static <E> ImmutableMultiset<E> of() {
return null;
}
public static <E> ImmutableMultiset<E> of(E element) {
return null;
}
public static <E> ImmutableMultiset<E> of(E e1, E e2) {
return null;
}
public static <E> ImmutableMultiset<E> of(E e1, E e2, E e3) {
return null;
}
public static <E> ImmutableMultiset<E> of(E e1, E e2, E e3, E e4) {
return null;
}
public static <E> ImmutableMultiset<E> of(E e1, E e2, E e3, E e4, E e5) {
return null;
}
public static <E> ImmutableMultiset<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E... others) {
return null;
}
public static <E> ImmutableMultiset<E> copyOf(E[] elements) {
return null;
}
public static <E> ImmutableMultiset<E> copyOf(Iterable<? extends E> elements) {
return null;
}
public static <E> ImmutableMultiset<E> copyOf(Iterator<? extends E> elements) {
return null;
}
@Override
public boolean contains(Object object) {
return false;
}
@Override
public final int add(E element, int occurrences) {
return 0;
}
@Override
public final int remove(Object element, int occurrences) {
return 0;
}
@Override
public final int setCount(E element, int count) {
return 0;
}
@Override
public final boolean setCount(E element, int oldCount, int newCount) {
return false;
}
@Override
public abstract ImmutableSet<E> elementSet();
@Override
public ImmutableSet<Entry<E>> entrySet() {
return null;
}
public static <E> Builder<E> builder() {
return null;
}
public static class Builder<E> extends ImmutableCollection.Builder<E> {
public Builder() {
abstract public class ImmutableMultiset<E> extends ImmutableMultisetGwtSerializationDependencies<E> implements Multiset<E>
{
public ImmutableList<E> asList(){ return null; }
public ImmutableSet<Multiset.Entry<E>> entrySet(){ return null; }
public String toString(){ return null; }
public UnmodifiableIterator<E> iterator(){ return null; }
public abstract ImmutableSet<E> elementSet();
public boolean contains(Object p0){ return false; }
public boolean equals(Object p0){ return false; }
public final boolean setCount(E p0, int p1, int p2){ return false; }
public final int add(E p0, int p1){ return 0; }
public final int remove(Object p0, int p1){ return 0; }
public final int setCount(E p0, int p1){ return 0; }
public int hashCode(){ return 0; }
public static <E> Collector<E, ? extends Object, ImmutableMultiset<E>> toImmutableMultiset(){ return null; }
public static <E> ImmutableMultiset.Builder<E> builder(){ return null; }
public static <E> ImmutableMultiset<E> copyOf(E[] p0){ return null; }
public static <E> ImmutableMultiset<E> copyOf(Iterable<? extends E> p0){ return null; }
public static <E> ImmutableMultiset<E> copyOf(Iterator<? extends E> p0){ return null; }
public static <E> ImmutableMultiset<E> of(){ return null; }
public static <E> ImmutableMultiset<E> of(E p0){ return null; }
public static <E> ImmutableMultiset<E> of(E p0, E p1){ return null; }
public static <E> ImmutableMultiset<E> of(E p0, E p1, E p2){ return null; }
public static <E> ImmutableMultiset<E> of(E p0, E p1, E p2, E p3){ return null; }
public static <E> ImmutableMultiset<E> of(E p0, E p1, E p2, E p3, E p4){ return null; }
public static <E> ImmutableMultiset<E> of(E p0, E p1, E p2, E p3, E p4, E p5, E... p6){ return null; }
public static <T, E> Collector<T, ? extends Object, ImmutableMultiset<E>> toImmutableMultiset(Function<? super T, ? extends E> p0, ToIntFunction<? super T> p1){ return null; }
static public class Builder<E> extends ImmutableCollection.Builder<E>
{
public Builder(){}
public ImmutableMultiset.Builder<E> add(E p0){ return null; }
public ImmutableMultiset.Builder<E> add(E... p0){ return null; }
public ImmutableMultiset.Builder<E> addAll(Iterable<? extends E> p0){ return null; }
public ImmutableMultiset.Builder<E> addAll(Iterator<? extends E> p0){ return null; }
public ImmutableMultiset.Builder<E> addCopies(E p0, int p1){ return null; }
public ImmutableMultiset.Builder<E> setCount(E p0, int p1){ return null; }
public ImmutableMultiset<E> build(){ return null; }
}
@Override
public Builder<E> add(E element) {
return null;
}
public Builder<E> addCopies(E element, int occurrences) {
return null;
}
public Builder<E> setCount(E element, int count) {
return null;
}
@Override
public ImmutableMultiset<E> build() {
return null;
}
}
}

View File

@@ -0,0 +1,9 @@
// Generated automatically from com.google.common.collect.ImmutableMultisetGwtSerializationDependencies for testing purposes
package com.google.common.collect;
import com.google.common.collect.ImmutableCollection;
abstract class ImmutableMultisetGwtSerializationDependencies<E> extends ImmutableCollection<E>
{
}

View File

@@ -1,86 +1,42 @@
/*
* Copyright (C) 2007 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated automatically from com.google.common.collect.ImmutableSet for testing purposes
package com.google.common.collect;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.UnmodifiableIterator;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
import java.util.stream.Collector;
public abstract class ImmutableSet<E> extends ImmutableCollection<E> implements Set<E> {
public static <E> ImmutableSet<E> of() {
return null;
}
public static <E> ImmutableSet<E> of(E element) {
return null;
}
public static <E> ImmutableSet<E> of(E e1, E e2) {
return null;
}
public static <E> ImmutableSet<E> of(E e1, E e2, E e3) {
return null;
}
public static <E> ImmutableSet<E> of(E e1, E e2, E e3, E e4) {
return null;
}
public static <E> ImmutableSet<E> of(E e1, E e2, E e3, E e4, E e5) {
return null;
}
public static <E> ImmutableSet<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E... others) {
return null;
}
public static <E> ImmutableSet<E> copyOf(Collection<? extends E> elements) {
return null;
}
public static <E> ImmutableSet<E> copyOf(Iterable<? extends E> elements) {
return null;
}
public static <E> ImmutableSet<E> copyOf(Iterator<? extends E> elements) {
return null;
}
public static <E> ImmutableSet<E> copyOf(E[] elements) {
return null;
}
ImmutableSet() {}
public static <E> Builder<E> builder() {
return null;
}
public static class Builder<E> extends ImmutableCollection.Builder<E> {
public Builder() {
abstract public class ImmutableSet<E> extends ImmutableCollection<E> implements Set<E>
{
public ImmutableList<E> asList(){ return null; }
public abstract UnmodifiableIterator<E> iterator();
public boolean equals(Object p0){ return false; }
public int hashCode(){ return 0; }
public static <E> Collector<E, ? extends Object, ImmutableSet<E>> toImmutableSet(){ return null; }
public static <E> ImmutableSet.Builder<E> builder(){ return null; }
public static <E> ImmutableSet.Builder<E> builderWithExpectedSize(int p0){ return null; }
public static <E> ImmutableSet<E> copyOf(Collection<? extends E> p0){ return null; }
public static <E> ImmutableSet<E> copyOf(E[] p0){ return null; }
public static <E> ImmutableSet<E> copyOf(Iterable<? extends E> p0){ return null; }
public static <E> ImmutableSet<E> copyOf(Iterator<? extends E> p0){ return null; }
public static <E> ImmutableSet<E> of(){ return null; }
public static <E> ImmutableSet<E> of(E p0){ return null; }
public static <E> ImmutableSet<E> of(E p0, E p1){ return null; }
public static <E> ImmutableSet<E> of(E p0, E p1, E p2){ return null; }
public static <E> ImmutableSet<E> of(E p0, E p1, E p2, E p3){ return null; }
public static <E> ImmutableSet<E> of(E p0, E p1, E p2, E p3, E p4){ return null; }
public static <E> ImmutableSet<E> of(E p0, E p1, E p2, E p3, E p4, E p5, E... p6){ return null; }
static public class Builder<E> extends ImmutableCollection.Builder<E>
{
public Builder(){}
public ImmutableSet.Builder<E> add(E p0){ return null; }
public ImmutableSet.Builder<E> add(E... p0){ return null; }
public ImmutableSet.Builder<E> addAll(Iterable<? extends E> p0){ return null; }
public ImmutableSet.Builder<E> addAll(Iterator<? extends E> p0){ return null; }
public ImmutableSet<E> build(){ return null; }
}
public Builder<E> add(E element) {
return null;
}
public ImmutableSet<E> build() {
return null;
}
}
}

View File

@@ -0,0 +1,47 @@
// Generated automatically from com.google.common.collect.ImmutableSetMultimap for testing purposes
package com.google.common.collect;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Multimap;
import com.google.common.collect.SetMultimap;
import java.util.Comparator;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collector;
import java.util.stream.Stream;
public class ImmutableSetMultimap<K, V> extends ImmutableMultimap<K, V> implements SetMultimap<K, V>
{
protected ImmutableSetMultimap() {}
public ImmutableSet<Map.Entry<K, V>> entries(){ return null; }
public ImmutableSet<V> get(K p0){ return null; }
public ImmutableSetMultimap<V, K> inverse(){ return null; }
public final ImmutableSet<V> removeAll(Object p0){ return null; }
public final ImmutableSet<V> replaceValues(K p0, Iterable<? extends V> p1){ return null; }
public static <K, V> ImmutableSetMultimap.Builder<K, V> builder(){ return null; }
public static <K, V> ImmutableSetMultimap<K, V> copyOf(Iterable<? extends Map.Entry<? extends K, ? extends V>> p0){ return null; }
public static <K, V> ImmutableSetMultimap<K, V> copyOf(Multimap<? extends K, ? extends V> p0){ return null; }
public static <K, V> ImmutableSetMultimap<K, V> of(){ return null; }
public static <K, V> ImmutableSetMultimap<K, V> of(K p0, V p1){ return null; }
public static <K, V> ImmutableSetMultimap<K, V> of(K p0, V p1, K p2, V p3){ return null; }
public static <K, V> ImmutableSetMultimap<K, V> of(K p0, V p1, K p2, V p3, K p4, V p5){ return null; }
public static <K, V> ImmutableSetMultimap<K, V> of(K p0, V p1, K p2, V p3, K p4, V p5, K p6, V p7){ return null; }
public static <K, V> ImmutableSetMultimap<K, V> of(K p0, V p1, K p2, V p3, K p4, V p5, K p6, V p7, K p8, V p9){ return null; }
public static <T, K, V> Collector<T, ? extends Object, ImmutableSetMultimap<K, V>> flatteningToImmutableSetMultimap(Function<? super T, ? extends K> p0, Function<? super T, ? extends Stream<? extends V>> p1){ return null; }
public static <T, K, V> Collector<T, ? extends Object, ImmutableSetMultimap<K, V>> toImmutableSetMultimap(Function<? super T, ? extends K> p0, Function<? super T, ? extends V> p1){ return null; }
static public class Builder<K, V> extends ImmutableMultimap.Builder<K, V>
{
public Builder(){}
public ImmutableSetMultimap.Builder<K, V> orderKeysBy(Comparator<? super K> p0){ return null; }
public ImmutableSetMultimap.Builder<K, V> orderValuesBy(Comparator<? super V> p0){ return null; }
public ImmutableSetMultimap.Builder<K, V> put(K p0, V p1){ return null; }
public ImmutableSetMultimap.Builder<K, V> put(Map.Entry<? extends K, ? extends V> p0){ return null; }
public ImmutableSetMultimap.Builder<K, V> putAll(Iterable<? extends Map.Entry<? extends K, ? extends V>> p0){ return null; }
public ImmutableSetMultimap.Builder<K, V> putAll(K p0, Iterable<? extends V> p1){ return null; }
public ImmutableSetMultimap.Builder<K, V> putAll(K p0, V... p1){ return null; }
public ImmutableSetMultimap.Builder<K, V> putAll(Multimap<? extends K, ? extends V> p0){ return null; }
public ImmutableSetMultimap<K, V> build(){ return null; }
}
}

View File

@@ -1,65 +1,34 @@
/*
* Copyright (C) 2007 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated automatically from com.google.common.collect.Multimap for testing purposes
package com.google.common.collect;
import com.google.common.collect.Multiset;
import java.util.Collection;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.function.BiConsumer;
public interface Multimap<K, V> {
int size();
boolean isEmpty();
boolean containsKey(Object key);
boolean containsValue(Object value);
boolean containsEntry(Object key, Object value);
boolean put(K key, V value);
boolean remove(Object key, Object value);
boolean putAll(K key, Iterable<? extends V> values);
boolean putAll(Multimap<? extends K, ? extends V> multimap);
Collection<V> replaceValues(K key, Iterable<? extends V> values);
Collection<V> removeAll(Object key);
void clear();
Collection<V> get(K key);
Set<K> keySet();
Multiset<K> keys();
Collection<V> values();
Collection<Entry<K, V>> entries();
default void forEach(BiConsumer<? super K, ? super V> action) {
}
Map<K, Collection<V>> asMap();
public interface Multimap<K, V>
{
Collection<Map.Entry<K, V>> entries();
Collection<V> get(K p0);
Collection<V> removeAll(Object p0);
Collection<V> replaceValues(K p0, Iterable<? extends V> p1);
Collection<V> values();
Map<K, Collection<V>> asMap();
Multiset<K> keys();
Set<K> keySet();
boolean containsEntry(Object p0, Object p1);
boolean containsKey(Object p0);
boolean containsValue(Object p0);
boolean equals(Object p0);
boolean isEmpty();
boolean put(K p0, V p1);
boolean putAll(K p0, Iterable<? extends V> p1);
boolean putAll(Multimap<? extends K, ? extends V> p0);
boolean remove(Object p0, Object p1);
default void forEach(BiConsumer<? super K, ? super V> p0){}
int hashCode();
int size();
void clear();
}

View File

@@ -1,49 +1,43 @@
/*
* Copyright (C) 2007 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated automatically from com.google.common.collect.Multiset for testing purposes
package com.google.common.collect;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
import java.util.Spliterator;
import java.util.function.Consumer;
import java.util.function.ObjIntConsumer;
public interface Multiset<E> extends Collection<E> {
int count(Object element);
int add(E element, int occurrences);
int remove(Object element, int occurrences);
int setCount(E element, int count);
boolean setCount(E element, int oldCount, int newCount);
Set<E> elementSet();
Set<Entry<E>> entrySet();
default void forEachEntry(ObjIntConsumer<? super E> action) {
}
boolean equals(Object object);
interface Entry<E> {
E getElement();
int getCount();
}
public interface Multiset<E> extends Collection<E>
{
Iterator<E> iterator();
Set<E> elementSet();
Set<Multiset.Entry<E>> entrySet();
String toString();
boolean add(E p0);
boolean contains(Object p0);
boolean containsAll(Collection<? extends Object> p0);
boolean equals(Object p0);
boolean remove(Object p0);
boolean removeAll(Collection<? extends Object> p0);
boolean retainAll(Collection<? extends Object> p0);
boolean setCount(E p0, int p1, int p2);
default Spliterator<E> spliterator(){ return null; }
default void forEach(Consumer<? super E> p0){}
default void forEachEntry(ObjIntConsumer<? super E> p0){}
int add(E p0, int p1);
int count(Object p0);
int hashCode();
int remove(Object p0, int p1);
int setCount(E p0, int p1);
int size();
static public interface Entry<E>
{
E getElement();
String toString();
boolean equals(Object p0);
int getCount();
int hashCode();
}
}

View File

@@ -0,0 +1,18 @@
// Generated automatically from com.google.common.collect.SetMultimap for testing purposes
package com.google.common.collect;
import com.google.common.collect.Multimap;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
public interface SetMultimap<K, V> extends Multimap<K, V>
{
Map<K, Collection<V>> asMap();
Set<Map.Entry<K, V>> entries();
Set<V> get(K p0);
Set<V> removeAll(Object p0);
Set<V> replaceValues(K p0, Iterable<? extends V> p1);
boolean equals(Object p0);
}

View File

@@ -0,0 +1,11 @@
// Generated automatically from com.google.common.collect.UnmodifiableIterator for testing purposes
package com.google.common.collect;
import java.util.Iterator;
abstract public class UnmodifiableIterator<E> implements Iterator<E>
{
protected UnmodifiableIterator(){}
public final void remove(){}
}

View File

@@ -0,0 +1,13 @@
// Generated automatically from com.google.common.collect.UnmodifiableListIterator for testing purposes
package com.google.common.collect;
import com.google.common.collect.UnmodifiableIterator;
import java.util.ListIterator;
abstract public class UnmodifiableListIterator<E> extends UnmodifiableIterator<E> implements ListIterator<E>
{
protected UnmodifiableListIterator(){}
public final void add(E p0){}
public final void set(E p0){}
}

View File

@@ -0,0 +1,11 @@
// Generated automatically from com.google.common.util.concurrent.ListenableFuture for testing purposes
package com.google.common.util.concurrent;
import java.util.concurrent.Executor;
import java.util.concurrent.Future;
public interface ListenableFuture<V> extends Future<V>
{
void addListener(Runnable p0, Executor p1);
}