package tv.ouya.console.api;

import android.os.Bundle;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public abstract class JsonResponseListener<T>
{
  public abstract void onCancel();
  
  public final void onFailure(int paramInt, String paramString)
  {
    onFailure(paramInt, paramString, Bundle.EMPTY);
  }
  
  public abstract void onFailure(int paramInt, String paramString, Bundle paramBundle);
  
  public final void onFailure(int paramInt, String paramString, Map<String, String[]> paramMap)
  {
    onFailure(paramInt, paramString, packageAsBundle(paramMap));
  }
  
  public abstract void onSuccess(T paramT);
  
  protected Bundle packageAsBundle(Map<String, String[]> paramMap)
  {
    Bundle localBundle = new Bundle();
    if ((paramMap != null) && (!paramMap.isEmpty()))
    {
      paramMap = paramMap.entrySet().iterator();
      while (paramMap.hasNext())
      {
        Map.Entry localEntry = (Map.Entry)paramMap.next();
        localBundle.putStringArray((String)localEntry.getKey(), (String[])localEntry.getValue());
      }
    }
    return localBundle;
  }
}


/* Location:              /home/enzo/Documents/hacking/malwares/viking-horde/classes.jar!/tv/ouya/console/api/JsonResponseListener.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */