package com.google.common.base; import java.util.Collections; import java.util.Set; import javax.annotation.CheckForNull; /* JADX INFO: Access modifiers changed from: package-private */ @ElementTypesAreNonnullByDefault /* loaded from: classes2.dex */ public final class Present extends Optional { private static final long serialVersionUID = 0; private final T reference; @Override // com.google.common.base.Optional public T get() { return this.reference; } @Override // com.google.common.base.Optional public boolean isPresent() { return true; } @Override // com.google.common.base.Optional public T orNull() { return this.reference; } /* JADX INFO: Access modifiers changed from: package-private */ public Present(T t) { this.reference = t; } @Override // com.google.common.base.Optional public T or(T t) { Preconditions.checkNotNull(t, "use Optional.orNull() instead of Optional.or(null)"); return this.reference; } @Override // com.google.common.base.Optional public Optional or(Optional optional) { Preconditions.checkNotNull(optional); return this; } @Override // com.google.common.base.Optional public T or(Supplier supplier) { Preconditions.checkNotNull(supplier); return this.reference; } @Override // com.google.common.base.Optional public Set asSet() { return Collections.singleton(this.reference); } @Override // com.google.common.base.Optional public Optional transform(Function function) { return new Present(Preconditions.checkNotNull(function.apply(this.reference), "the Function passed to Optional.transform() must not return null.")); } @Override // com.google.common.base.Optional public boolean equals(@CheckForNull Object obj) { if (obj instanceof Present) { return this.reference.equals(((Present) obj).reference); } return false; } @Override // com.google.common.base.Optional public int hashCode() { return this.reference.hashCode() + 1502476572; } @Override // com.google.common.base.Optional public String toString() { String valueOf = String.valueOf(this.reference); return new StringBuilder(String.valueOf(valueOf).length() + 13).append("Optional.of(").append(valueOf).append(")").toString(); } }