app/src/main/java/io/github/ilya_lebedev/popularmovies/data/MoviesProvider.java
/**
     * Creates the UriMatcher that match each URI to the CODEs constants defined above.
     *
     * @return A UriMatcher
     */
Creates the UriMatcher that match each URI to the CODEs constants defined above.
Creates the UriMatcher that match each URI to the CODEs constants defined above .
public static UriMatcher buildUriMatcher() {
        final UriMatcher matcher = new UriMatcher(UriMatcher.NO_MATCH);
        final String authority = MoviesContract.CONTENT_AUTHORITY;
        matcher.addURI(authority, MoviesContract.PATH_TOP_RATED_MOVIE, CODE_TOP_RATED_MOVIE);
        matcher.addURI(authority, MoviesContract.PATH_TOP_RATED_MOVIE + "/#",
                CODE_TOP_RATED_MOVIE_WITH_TMDB_ID);
        matcher.addURI(authority, MoviesContract.PATH_MOST_POPULAR_MOVIE, CODE_MOST_POPULAR_MOVIE);
        matcher.addURI(authority, MoviesContract.PATH_MOST_POPULAR_MOVIE + "/#",
                CODE_MOST_POPULAR_MOVIE_WITH_TMDB_ID);
        matcher.addURI(authority, MoviesContract.PATH_FAVORITE_MOVIE, CODE_FAVORITE_MOVIE);
        matcher.addURI(authority, MoviesContract.PATH_FAVORITE_MOVIE + "/#",
                CODE_FAVORITE_MOVIE_WITH_TMDB_ID);
        matcher.addURI(authority, MoviesContract.PATH_MOVIE_VIDEOS, CODE_MOVIE_VIDEO);
        matcher.addURI(authority, MoviesContract.PATH_MOVIE_VIDEOS + "/#",
                CODE_MOVIE_VIDEO_WITH_ID);
        matcher.addURI(authority,
                MoviesContract.PATH_MOVIE_VIDEOS + "/" + MoviesContract.PATH_MOVIE_TMDB_ID + "/#",
                CODE_MOVIE_VIDEO_WITH_MOVIE_TMDB_ID);
        matcher.addURI(authority, MoviesContract.PATH_MOVIE_REVIEWS, CODE_MOVIE_REVIEW);
        matcher.addURI(authority, MoviesContract.PATH_MOVIE_REVIEWS + "/#",
                CODE_MOVIE_REVIEW_WITH_ID);
        matcher.addURI(authority,
                MoviesContract.PATH_MOVIE_REVIEWS + "/" + MoviesContract.PATH_MOVIE_TMDB_ID + "/#",
                CODE_MOVIE_REVIEW_WITH_MOVIE_TMDB_ID);
        return matcher;
    }
public static UriMatcher buildUriMatcher ( ) { final UriMatcher matcher = new UriMatcher ( UriMatcher . NO_MATCH ) ; final String authority = MoviesContract . CONTENT_AUTHORITY ; matcher . addURI ( authority , MoviesContract . PATH_TOP_RATED_MOVIE , CODE_TOP_RATED_MOVIE ) ; matcher . addURI ( authority , MoviesContract . PATH_TOP_RATED_MOVIE + "/#" , CODE_TOP_RATED_MOVIE_WITH_TMDB_ID ) ; matcher . addURI ( authority , MoviesContract . PATH_MOST_POPULAR_MOVIE , CODE_MOST_POPULAR_MOVIE ) ; matcher . addURI ( authority , MoviesContract . PATH_MOST_POPULAR_MOVIE + "/#" , CODE_MOST_POPULAR_MOVIE_WITH_TMDB_ID ) ; matcher . addURI ( authority , MoviesContract . PATH_FAVORITE_MOVIE , CODE_FAVORITE_MOVIE ) ; matcher . addURI ( authority , MoviesContract . PATH_FAVORITE_MOVIE + "/#" , CODE_FAVORITE_MOVIE_WITH_TMDB_ID ) ; matcher . addURI ( authority , MoviesContract . PATH_MOVIE_VIDEOS , CODE_MOVIE_VIDEO ) ; matcher . addURI ( authority , MoviesContract . PATH_MOVIE_VIDEOS + "/#" , CODE_MOVIE_VIDEO_WITH_ID ) ; matcher . addURI ( authority , MoviesContract . PATH_MOVIE_VIDEOS + "/" + MoviesContract . PATH_MOVIE_TMDB_ID + "/#" , CODE_MOVIE_VIDEO_WITH_MOVIE_TMDB_ID ) ; matcher . addURI ( authority , MoviesContract . PATH_MOVIE_REVIEWS , CODE_MOVIE_REVIEW ) ; matcher . addURI ( authority , MoviesContract . PATH_MOVIE_REVIEWS + "/#" , CODE_MOVIE_REVIEW_WITH_ID ) ; matcher . addURI ( authority , MoviesContract . PATH_MOVIE_REVIEWS + "/" + MoviesContract . PATH_MOVIE_TMDB_ID + "/#" , CODE_MOVIE_REVIEW_WITH_MOVIE_TMDB_ID ) ; return matcher ; }
Creates the UriMatcher that match each URI to the CODEs constants defined above.
Creates the UriMatcher that match each URI to the CODEs constants defined above .