ReportOptionAdapter.java 2.43 KB
package com.snapchat.soju.shared.android.air;

import com.google.gson.Gson;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;

public final class ReportOptionAdapter
  extends TypeAdapter<ReportOption>
{
  private final Gson a;
  
  public ReportOptionAdapter(Gson paramGson)
  {
    this.a = paramGson;
  }
  
  public final ReportOption read(JsonReader paramJsonReader)
    throws IOException
  {
    if (paramJsonReader.peek() == JsonToken.NULL)
    {
      paramJsonReader.nextNull();
      return null;
    }
    ReportOptionNative localReportOptionNative = new ReportOptionNative();
    paramJsonReader.setLenient(true);
    paramJsonReader.beginObject();
    label34:
    while (paramJsonReader.hasNext())
    {
      Object localObject = paramJsonReader.nextName();
      int i = -1;
      switch (((String)localObject).hashCode())
      {
      }
      for (;;)
      {
        switch (i)
        {
        default: 
          paramJsonReader.skipValue();
          break label34;
          if (((String)localObject).equals("create_jira")) {
            i = 0;
          }
          break;
        }
      }
      localObject = paramJsonReader.peek();
      if (localObject == JsonToken.NULL)
      {
        paramJsonReader.nextNull();
      }
      else
      {
        if (localObject == JsonToken.STRING) {}
        for (boolean bool = Boolean.parseBoolean(paramJsonReader.nextString());; bool = paramJsonReader.nextBoolean())
        {
          localReportOptionNative.setCreateJira(Boolean.valueOf(bool));
          break;
        }
      }
    }
    paramJsonReader.endObject();
    return localReportOptionNative;
  }
  
  public final void write(JsonWriter paramJsonWriter, ReportOption paramReportOption)
    throws IOException
  {
    if (paramReportOption == null)
    {
      paramJsonWriter.nullValue();
      return;
    }
    paramJsonWriter.setLenient(true);
    paramJsonWriter.beginObject();
    if (paramReportOption.getCreateJira() != null)
    {
      paramJsonWriter.name("create_jira");
      paramJsonWriter.value(paramReportOption.getCreateJira().booleanValue());
    }
    paramJsonWriter.endObject();
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/com/snapchat/soju/shared/android/air/ReportOptionAdapter.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */