package com.jakewharton.u2020.util;

import android.content.SharedPreferences;

public final class EnumPreferences {
  private EnumPreferences() {
  }

  public static <T extends Enum> T getEnumValue(SharedPreferences preferences, Class<T> type,
      String key, T defaultValue) {
    String name = preferences.getString(key, null);
    if (name != null) {
      try {
        return type.cast(Enum.valueOf(type, name));
      } catch (IllegalArgumentException ignored) {
      }
    }

    return defaultValue;
  }

  public static void saveEnumValue(SharedPreferences preferences, String key, Enum value) {
    preferences.edit().putString(key, value.name()).apply();
  }
}

@@ -176,16 +176,19 @@
 nds Enum
+%3CT%3E
 %3E T getE
@@ -385,18 +385,8 @@
 urn 
-type.cast(
 Enum
@@ -405,17 +405,16 @@
 e, name)
-)
 ;%0A      

Remove explicit enum cast.