Android Open Source - android-javarx-example Utils






From Project

Back to project page android-javarx-example.

License

The source code is released under:

Apache License

If you think the Android project android-javarx-example listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.bnsantos.movies;
//from w  w  w  .  j  ava 2  s.  co  m
import com.bnsantos.movies.model.Movie;
import com.bnsantos.movies.model.ReleaseDates;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import java.util.List;

/**
 * Created by bruno on 14/11/14.
 */
public class Utils {
    public static class Json {
        public static final String DATE_FORMAT = "yyyy-MM-dd";

        public static Gson releaseDatesGsonConverter() {
            return new GsonBuilder()
                    .setDateFormat(DATE_FORMAT)
                    .create();
        }
    }

    public static class StringUtils {
        public static boolean stringCompare(String s1, String s2) {
            if (s1 == null && s2 == null) {
                return true;
            } else if (s1 == null) {
                return false;
            } else {
                return s1.equals(s2);
            }
        }
    }

    public static class MovieUtils {
        public static boolean movieListCompare(List<Movie> m1, List<Movie> m2) {
            if (m1 == null && m2 == null) {
                return true;
            } else if (m1 == null) {
                return false;
            } else {
                return m1.equals(m2);
            }
        }
    }
}




Java Source Code List

com.bnsantos.movies.App.java
com.bnsantos.movies.MovieServiceTest.java
com.bnsantos.movies.MoviesTestRunner.java
com.bnsantos.movies.TestSuite.java
com.bnsantos.movies.TestUtils.java
com.bnsantos.movies.Utils.java
com.bnsantos.movies.activities.MainActivity.java
com.bnsantos.movies.adapter.MovieAdapter.java
com.bnsantos.movies.cache.MovieCaching.java
com.bnsantos.movies.cache.PersistentManager.java
com.bnsantos.movies.model.Links.java
com.bnsantos.movies.model.MovieListType.java
com.bnsantos.movies.model.MovieResponse.java
com.bnsantos.movies.model.Movie.java
com.bnsantos.movies.model.Posters.java
com.bnsantos.movies.model.Ratings.java
com.bnsantos.movies.model.ReleaseDates.java
com.bnsantos.movies.providers.LazyMovieProvider.java
com.bnsantos.movies.providers.MovieProvider.java
com.bnsantos.movies.providers.SubjectMovieProvider.java
com.bnsantos.movies.services.MovieService.java
com.bnsantos.movies.services.RestErrorHandler.java