1/*
2 * Copyright (C) 2009 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
17package com.google.common.base;
18
19import com.google.common.annotations.GwtCompatible;
20
21import java.util.Set;
22
23import javax.annotation.Nullable;
24
25/**
26 * Contains dummy collection implementations to convince GWT that part of
27 * serializing a collection is serializing its elements.
28 *
29 * <p>See {@linkplain com.google.common.collect.GwtSerializationDependencies the
30 * com.google.common.collect version} for more details.
31 *
32 * @author Chris Povirk
33 */
34@GwtCompatible
35final class GwtSerializationDependencies {
36  private GwtSerializationDependencies() {}
37
38  static final class OptionalDependencies<T> extends Optional<T> {
39    T value;
40
41    OptionalDependencies() {
42      super();
43    }
44
45    @Override public boolean isPresent() {
46      throw new AssertionError();
47    }
48
49    @Override public T get() {
50      throw new AssertionError();
51    }
52
53    @Override public T or(T defaultValue) {
54      throw new AssertionError();
55    }
56
57    @Override public Optional<T> or(Optional<? extends T> secondChoice) {
58      throw new AssertionError();
59    }
60
61    @Override public T or(Supplier<? extends T> supplier) {
62      throw new AssertionError();
63    }
64
65    @Override public T orNull() {
66      throw new AssertionError();
67    }
68
69    @Override public Set<T> asSet() {
70      throw new AssertionError();
71    }
72
73    @Override public <V> Optional<V> transform(
74        Function<? super T, V> function) {
75      throw new AssertionError();
76    }
77
78    @Override public boolean equals(@Nullable Object object) {
79      throw new AssertionError();
80    }
81
82    @Override public int hashCode() {
83      throw new AssertionError();
84    }
85
86    @Override public String toString() {
87      throw new AssertionError();
88    }
89  }
90}
91