package com.google.common.base; import java.util.Collections; import java.util.Set; /* JADX INFO: Access modifiers changed from: package-private */ /* 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 final boolean isPresent() { return true; } /* JADX INFO: Access modifiers changed from: package-private */ public Present(T t) { this.reference = t; } @Override // com.google.common.base.Optional public final 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 final Optional or(Optional optional) { Preconditions.checkNotNull(optional); return this; } @Override // com.google.common.base.Optional public final T or(Supplier supplier) { Preconditions.checkNotNull(supplier); return this.reference; } @Override // com.google.common.base.Optional public final Set asSet() { return Collections.singleton(this.reference); } @Override // com.google.common.base.Optional public final 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 final boolean equals(Object obj) { if (obj instanceof Present) { return this.reference.equals(((Present) obj).reference); } return false; } @Override // com.google.common.base.Optional public final int hashCode() { return this.reference.hashCode() + 1502476572; } @Override // com.google.common.base.Optional public final String toString() { String valueOf = String.valueOf(this.reference); StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 13); sb.append("Optional.of("); sb.append(valueOf); sb.append(")"); return sb.toString(); } @Override // com.google.common.base.Optional public final T orNull() { return this.reference; } @Override // com.google.common.base.Optional public final T get() { return this.reference; } }