Skip to content

Commit c12f803

Browse files
Add stubs for unit tests
1 parent 56e611f commit c12f803

29 files changed

+1478
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (C) 2007 The Guava Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License
10+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
* or implied. See the License for the specific language governing permissions and limitations under
12+
* the License.
13+
*/
14+
15+
package com.google.common.base;
16+
import org.checkerframework.checker.nullness.qual.Nullable;
17+
18+
public interface Function<F, T> extends java.util.function.Function<F, T> {
19+
@Override
20+
T apply(@Nullable F input);
21+
22+
@Override
23+
boolean equals(@Nullable Object object);
24+
25+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* Copyright (C) 2011 The Guava Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License
10+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
* or implied. See the License for the specific language governing permissions and limitations under
12+
* the License.
13+
*/
14+
15+
package com.google.common.base;
16+
import java.io.Serializable;
17+
import java.util.Set;
18+
import org.checkerframework.checker.nullness.qual.Nullable;
19+
20+
public abstract class Optional<T> implements Serializable {
21+
public static <T> Optional<T> absent() {
22+
return null;
23+
}
24+
25+
public static <T> Optional<T> of(T reference) {
26+
return null;
27+
}
28+
29+
public static <T> Optional<T> fromNullable(@Nullable T nullableReference) {
30+
return null;
31+
}
32+
33+
public static <T> @Nullable Optional<T> fromJavaUtil(
34+
java.util.Optional<T> javaUtilOptional) {
35+
return null;
36+
}
37+
38+
public static <T> java.util.Optional<T> toJavaUtil(
39+
@Nullable Optional<T> googleOptional) {
40+
return null;
41+
}
42+
43+
public java.util.Optional<T> toJavaUtil() {
44+
return null;
45+
}
46+
47+
public abstract boolean isPresent();
48+
49+
public abstract T get();
50+
51+
public abstract T or(T defaultValue);
52+
53+
public abstract Optional<T> or(Optional<? extends T> secondChoice);
54+
55+
public abstract T or(Supplier<? extends T> supplier);
56+
57+
public abstract @Nullable T orNull();
58+
59+
public abstract Set<T> asSet();
60+
61+
public abstract <V> Optional<V> transform(Function<? super T, V> function);
62+
63+
@Override
64+
public abstract boolean equals(@Nullable Object object);
65+
66+
@Override
67+
public abstract int hashCode();
68+
69+
@Override
70+
public abstract String toString();
71+
72+
public static <T> Iterable<T> presentInstances(
73+
final Iterable<? extends Optional<? extends T>> optionals) {
74+
return null;
75+
}
76+
77+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (C) 2007 The Guava Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License
10+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
* or implied. See the License for the specific language governing permissions and limitations under
12+
* the License.
13+
*/
14+
15+
package com.google.common.base;
16+
import org.checkerframework.checker.nullness.qual.Nullable;
17+
18+
public interface Predicate<T> extends java.util.function.Predicate<T> {
19+
boolean apply(@Nullable T input);
20+
21+
@Override
22+
boolean equals(@Nullable Object object);
23+
24+
@Override
25+
default boolean test(@Nullable T input) {
26+
return false;
27+
}
28+
29+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (C) 2007 The Guava Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License
10+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
* or implied. See the License for the specific language governing permissions and limitations under
12+
* the License.
13+
*/
14+
15+
package com.google.common.base;
16+
17+
public interface Supplier<T> extends java.util.function.Supplier<T> {
18+
@Override
19+
T get();
20+
21+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (C) 2014 The Guava Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.common.graph;
18+
19+
public interface SuccessorsFunction<N> {
20+
Iterable<? extends N> successors(N node);
21+
22+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright (C) 2017 The Guava Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.common.graph;
18+
19+
public abstract class Traverser<N> {
20+
public static <N> Traverser<N> forGraph(final SuccessorsFunction<N> graph) {
21+
return null;
22+
}
23+
24+
public static <N> Traverser<N> forTree(final SuccessorsFunction<N> tree) {
25+
return null;
26+
}
27+
28+
public final Iterable<N> breadthFirst(N startNode) {
29+
return null;
30+
}
31+
32+
public final Iterable<N> breadthFirst(Iterable<? extends N> startNodes) {
33+
return null;
34+
}
35+
36+
public final Iterable<N> depthFirstPreOrder(N startNode) {
37+
return null;
38+
}
39+
40+
public final Iterable<N> depthFirstPreOrder(Iterable<? extends N> startNodes) {
41+
return null;
42+
}
43+
44+
public final Iterable<N> depthFirstPostOrder(N startNode) {
45+
return null;
46+
}
47+
48+
public final Iterable<N> depthFirstPostOrder(Iterable<? extends N> startNodes) {
49+
return null;
50+
}
51+
52+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (C) 2011 The Guava Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License
10+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
* or implied. See the License for the specific language governing permissions and limitations under
12+
* the License.
13+
*/
14+
15+
package com.google.common.hash;
16+
import java.io.Serializable;
17+
18+
public interface Funnel<T> extends Serializable {
19+
void funnel(T from, PrimitiveSink into);
20+
21+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright (C) 2011 The Guava Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License
10+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
* or implied. See the License for the specific language governing permissions and limitations under
12+
* the License.
13+
*/
14+
15+
package com.google.common.hash;
16+
import org.checkerframework.checker.nullness.qual.Nullable;
17+
18+
public abstract class HashCode {
19+
public abstract int bits();
20+
21+
public abstract int asInt();
22+
23+
public abstract long asLong();
24+
25+
public abstract long padToLong();
26+
27+
public abstract byte[] asBytes();
28+
29+
public int writeBytesTo(byte[] dest, int offset, int maxLength) {
30+
return 0;
31+
}
32+
33+
public static HashCode fromInt(int hash) {
34+
return null;
35+
}
36+
37+
public static HashCode fromLong(long hash) {
38+
return null;
39+
}
40+
41+
public static HashCode fromBytes(byte[] bytes) {
42+
return null;
43+
}
44+
45+
public static HashCode fromString(String string) {
46+
return null;
47+
}
48+
49+
@Override
50+
public final boolean equals(@Nullable Object object) {
51+
return false;
52+
}
53+
54+
@Override
55+
public final int hashCode() {
56+
return 0;
57+
}
58+
59+
@Override
60+
public final String toString() {
61+
return null;
62+
}
63+
64+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright (C) 2011 The Guava Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License
10+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
* or implied. See the License for the specific language governing permissions and limitations under
12+
* the License.
13+
*/
14+
15+
package com.google.common.hash;
16+
import java.nio.ByteBuffer;
17+
import java.nio.charset.Charset;
18+
19+
public interface HashFunction {
20+
Hasher newHasher();
21+
22+
Hasher newHasher(int expectedInputSize);
23+
24+
HashCode hashInt(int input);
25+
26+
HashCode hashLong(long input);
27+
28+
HashCode hashBytes(byte[] input);
29+
30+
HashCode hashBytes(byte[] input, int off, int len);
31+
32+
HashCode hashBytes(ByteBuffer input);
33+
34+
HashCode hashUnencodedChars(CharSequence input);
35+
36+
HashCode hashString(CharSequence input, Charset charset);
37+
38+
<T> HashCode hashObject(T instance, Funnel<? super T> funnel);
39+
40+
int bits();
41+
42+
}

0 commit comments

Comments
 (0)