mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-17 03:17:17 +01:00
85 lines
2.4 KiB
Java
85 lines
2.4 KiB
Java
package com.google.common.base;
|
|
|
|
import com.google.common.annotations.GwtCompatible;
|
|
import com.google.common.annotations.GwtIncompatible;
|
|
import com.google.common.annotations.J2ktIncompatible;
|
|
import java.util.Collections;
|
|
import java.util.Set;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@GwtCompatible
|
|
/* loaded from: classes8.dex */
|
|
final class Absent<T> extends Optional<T> {
|
|
static final Absent<Object> INSTANCE = new Absent<>();
|
|
|
|
@J2ktIncompatible
|
|
@GwtIncompatible
|
|
private static final long serialVersionUID = 0;
|
|
|
|
private Absent() {
|
|
}
|
|
|
|
private Object readResolve() {
|
|
return INSTANCE;
|
|
}
|
|
|
|
public static <T> Optional<T> withType() {
|
|
return INSTANCE;
|
|
}
|
|
|
|
@Override // com.google.common.base.Optional
|
|
public Set<T> asSet() {
|
|
return Collections.EMPTY_SET;
|
|
}
|
|
|
|
@Override // com.google.common.base.Optional
|
|
public boolean equals(Object obj) {
|
|
return obj == this;
|
|
}
|
|
|
|
@Override // com.google.common.base.Optional
|
|
public T get() {
|
|
throw new IllegalStateException("Optional.get() cannot be called on an absent value");
|
|
}
|
|
|
|
@Override // com.google.common.base.Optional
|
|
public int hashCode() {
|
|
return 2040732332;
|
|
}
|
|
|
|
@Override // com.google.common.base.Optional
|
|
public boolean isPresent() {
|
|
return false;
|
|
}
|
|
|
|
@Override // com.google.common.base.Optional
|
|
public T or(Supplier<? extends T> supplier) {
|
|
return (T) Preconditions.checkNotNull(supplier.get(), "use Optional.orNull() instead of a Supplier that returns null");
|
|
}
|
|
|
|
@Override // com.google.common.base.Optional
|
|
public T orNull() {
|
|
return null;
|
|
}
|
|
|
|
@Override // com.google.common.base.Optional
|
|
public String toString() {
|
|
return "Optional.absent()";
|
|
}
|
|
|
|
@Override // com.google.common.base.Optional
|
|
public <V> Optional<V> transform(Function<? super T, V> function) {
|
|
Preconditions.checkNotNull(function);
|
|
return Optional.absent();
|
|
}
|
|
|
|
@Override // com.google.common.base.Optional
|
|
public Optional<T> or(Optional<? extends T> optional) {
|
|
return (Optional) Preconditions.checkNotNull(optional);
|
|
}
|
|
|
|
@Override // com.google.common.base.Optional
|
|
public T or(T t) {
|
|
return (T) Preconditions.checkNotNull(t, "use Optional.orNull() instead of Optional.or(null)");
|
|
}
|
|
}
|