package com.google.common.base; import java.io.Serializable; import java.util.Iterator; import java.util.Set; /* loaded from: classes2.dex */ public abstract class Optional implements Serializable { private static final long serialVersionUID = 0; public abstract Set asSet(); public abstract boolean equals(Object obj); public abstract T get(); public abstract int hashCode(); public abstract boolean isPresent(); public abstract Optional or(Optional optional); public abstract T or(Supplier supplier); public abstract T or(T t); public abstract T orNull(); public abstract String toString(); public abstract Optional transform(Function function); public static Optional absent() { return Absent.withType(); } public static Optional of(T t) { return new Present(Preconditions.checkNotNull(t)); } public static Optional fromNullable(T t) { return t == null ? absent() : new Present(t); } /* renamed from: com.google.common.base.Optional$1, reason: invalid class name */ /* loaded from: classes2.dex */ class AnonymousClass1 implements Iterable { final Iterable val$optionals; AnonymousClass1(Iterable iterable) { this.val$optionals = iterable; } @Override // java.lang.Iterable public Iterator iterator() { return new AbstractIterator(this) { // from class: com.google.common.base.Optional.1.1 private final Iterator> iterator; final AnonymousClass1 this$0; { this.this$0 = this; this.iterator = (Iterator) Preconditions.checkNotNull(this.val$optionals.iterator()); } @Override // com.google.common.base.AbstractIterator protected T computeNext() { while (this.iterator.hasNext()) { Optional next = this.iterator.next(); if (next.isPresent()) { return next.get(); } } return endOfData(); } }; } } public static Iterable presentInstances(Iterable> iterable) { Preconditions.checkNotNull(iterable); return new AnonymousClass1(iterable); } }