<commit_before>package com.poepoemyintswe.popularmovies.api;

import com.google.gson.JsonObject;
import com.poepoemyintswe.popularmovies.BuildConfig;
import com.squareup.okhttp.OkHttpClient;
import retrofit.RestAdapter;
import retrofit.client.OkClient;
import retrofit.http.GET;
import retrofit.http.Query;
import rx.Observable;

import static com.poepoemyintswe.popularmovies.Config.API_KEY;
import static com.poepoemyintswe.popularmovies.Config.BASE_URL;
import static com.poepoemyintswe.popularmovies.Config.DISCOVER_MOVIE;
import static com.poepoemyintswe.popularmovies.Config.SORT_BY;

/**
 * Created by poepoe on 11/7/15.
 */
public class MyRestAdapter {

  private MyService myService;
  private static MyRestAdapter myRestAdapter;

  public MyRestAdapter() {
    myService = restAdapter().create(MyService.class);
  }

  public static synchronized MyRestAdapter getInstance() {
    if (myRestAdapter == null) {
      myRestAdapter = new MyRestAdapter();
    }
    return myRestAdapter;
  }

  public RestAdapter restAdapter() {

    RestAdapter restAdapter;

    if (BuildConfig.DEBUG) {
      restAdapter = new retrofit.RestAdapter.Builder().setEndpoint(BASE_URL)
          .setLogLevel(RestAdapter.LogLevel.FULL)
          .setClient(new OkClient(new OkHttpClient()))
          .build();
    } else {
      restAdapter = new retrofit.RestAdapter.Builder().setEndpoint(BASE_URL)
          .setClient(new OkClient(new OkHttpClient()))
          .build();
    }

    return restAdapter;
  }

  public Observable<JsonObject> getMovies() {
    return myService.getMovies("popularity.desc");
  }

  interface MyService {
    @GET(DISCOVER_MOVIE + "?" + API_KEY + "=" + BuildConfig.KEY) Observable<JsonObject> getMovies(<commit_msg>change jsonobject to data model<commit_after>package com.poepoemyintswe.popularmovies.api;

import com.poepoemyintswe.popularmovies.BuildConfig;
import com.poepoemyintswe.popularmovies.model.Movie;
import com.squareup.okhttp.OkHttpClient;
import retrofit.RestAdapter;
import retrofit.client.OkClient;
import retrofit.http.GET;
import retrofit.http.Query;
import rx.Observable;

import static com.poepoemyintswe.popularmovies.Config.API_KEY;
import static com.poepoemyintswe.popularmovies.Config.BASE_URL;
import static com.poepoemyintswe.popularmovies.Config.DISCOVER_MOVIE;
import static com.poepoemyintswe.popularmovies.Config.SORT_BY;

/**
 * Created by poepoe on 11/7/15.
 */
public class MyRestAdapter {

  private MyService myService;
  private static MyRestAdapter myRestAdapter;

  public MyRestAdapter() {
    myService = restAdapter().create(MyService.class);
  }

  public static synchronized MyRestAdapter getInstance() {
    if (myRestAdapter == null) {
      myRestAdapter = new MyRestAdapter();
    }
    return myRestAdapter;
  }

  public RestAdapter restAdapter() {

    RestAdapter restAdapter;

    if (BuildConfig.DEBUG) {
      restAdapter = new retrofit.RestAdapter.Builder().setEndpoint(BASE_URL)
          .setLogLevel(RestAdapter.LogLevel.FULL)
          .setClient(new OkClient(new OkHttpClient()))
          .build();
    } else {
      restAdapter = new retrofit.RestAdapter.Builder().setEndpoint(BASE_URL)
          .setClient(new OkClient(new OkHttpClient()))
          .build();
    }

    return restAdapter;
  }

  public Observable<Movie> getMovies() {
    return myService.getMovies("popularity.desc");
  }

  interface MyService {
    @GET(DISCOVER_MOVIE + "?" + API_KEY + "=" + BuildConfig.KEY) Observable<Movie> getMovies(
{'fraction_non_alphanumeric': 0.102116704805492, 'fraction_numerical': 0.002860411899313501, 'mean_word_length': 4.157817109144543, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4557270', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1081, 'n_words': 201}