package com.bumptech.glide.load; import com.bumptech.glide.util.Preconditions; import java.security.MessageDigest; /* loaded from: classes.dex */ public final class Option { private static final CacheKeyUpdater e = new CacheKeyUpdater() { // from class: com.bumptech.glide.load.Option.1 @Override // com.bumptech.glide.load.Option.CacheKeyUpdater public void a(byte[] bArr, Object obj, MessageDigest messageDigest) { } }; private final T a; private final CacheKeyUpdater b; private final String c; private volatile byte[] d; public interface CacheKeyUpdater { void a(byte[] bArr, T t, MessageDigest messageDigest); } private Option(String str, T t, CacheKeyUpdater cacheKeyUpdater) { Preconditions.a(str); this.c = str; this.a = t; Preconditions.a(cacheKeyUpdater); this.b = cacheKeyUpdater; } public static Option a(String str) { return new Option<>(str, null, b()); } private static CacheKeyUpdater b() { return (CacheKeyUpdater) e; } private byte[] c() { if (this.d == null) { this.d = this.c.getBytes(Key.a); } return this.d; } public boolean equals(Object obj) { if (obj instanceof Option) { return this.c.equals(((Option) obj).c); } return false; } public int hashCode() { return this.c.hashCode(); } public String toString() { return "Option{key='" + this.c + "'}"; } public static Option a(String str, T t) { return new Option<>(str, t, b()); } public static Option a(String str, T t, CacheKeyUpdater cacheKeyUpdater) { return new Option<>(str, t, cacheKeyUpdater); } public T a() { return this.a; } public void a(T t, MessageDigest messageDigest) { this.b.a(c(), t, messageDigest); } }