Initial commit
This commit is contained in:
55
sources/com/google/common/collect/ImmutableAsList.java
Normal file
55
sources/com/google/common/collect/ImmutableAsList.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.io.InvalidObjectException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class ImmutableAsList<E> extends ImmutableList<E> {
|
||||
|
||||
static class SerializedForm implements Serializable {
|
||||
final ImmutableCollection<?> a;
|
||||
|
||||
SerializedForm(ImmutableCollection<?> immutableCollection) {
|
||||
this.a = immutableCollection;
|
||||
}
|
||||
|
||||
Object readResolve() {
|
||||
return this.a.asList();
|
||||
}
|
||||
}
|
||||
|
||||
ImmutableAsList() {
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream objectInputStream) throws InvalidObjectException {
|
||||
throw new InvalidObjectException("Use SerializedForm");
|
||||
}
|
||||
|
||||
abstract ImmutableCollection<E> a();
|
||||
|
||||
@Override // com.google.common.collect.ImmutableList, com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public boolean contains(Object obj) {
|
||||
return a().contains(obj);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
|
||||
public boolean isEmpty() {
|
||||
return a().isEmpty();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection
|
||||
boolean isPartialView() {
|
||||
return a().isPartialView();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
|
||||
public int size() {
|
||||
return a().size();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableList, com.google.common.collect.ImmutableCollection
|
||||
Object writeReplace() {
|
||||
return new SerializedForm(a());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user