package com.example.burcakdemircioglu.wannabeer.data;

import android.net.Uri;

/**
 * Created by burcakdemircioglu on 19/04/16.
 */
public class BeersContract {
    public static final String CONTENT_AUTHORITY = "com.example.burcakdemircioglu.wannabeer";
    public static final Uri BASE_URI = Uri.parse("content://com.example.burcakdemircioglu.wannabeer");

    interface ItemsColumns {
        /** Type: INTEGER PRIMARY KEY AUTOINCREMENT */
        String _ID = "_id";
        /** Type: TEXT */
        String SERVER_ID = "server_id";
        /** Type: TEXT NOT NULL */
        String NAME = "name";
        /** Type: TEXT NOT NULL */
        String PHOTO = "photo";
        /** Type: TEXT NOT NULL */
        String KIND = "kind";
        /** Type: TEXT NOT NULL */
        String BOTTLE = "bottle";
        /** Type: TEXT NOT NULL */
        String COUNTRY = "country";
        /** Type: REAL NOT NULL DEFAULT 1.5 */
        String ALCOHOL_PERCENTAGE = "alcoholPercentage";
        /** Type: TEXT */
        String LOCATION = "location";
        /** Type: TEXT NOT NULL */
        String DESCRIPTION = "description";
    }

    public static class Items implements ItemsColumns {
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.com.example.burcakdemircioglu.wannabeer.items";
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.com.example.burcakdemircioglu.wannabeer.items";

        public static final String DEFAULT_SORT = NAME + " ASC";

        /** Matches: /items/ */
        public static Uri buildDirUri() {
            return BASE_URI.buildUpon().appendPath("items").build();
        }

        /** Matches: /items/[_id]/ */
        public static Uri buildItemUri(long _id) {
            return BASE_URI.buildUpon().appendPath("items").appendPath(Long.toString(_id)).build();
        }
        public static Uri buildKindUri(String kind) {
            return BASE_URI.buildUpon().appendPath("items").appendPath("kinds").appendPath(kind).build();
        }

        /** Read item ID item detail URI. */
        public static long getItemId(Uri itemUri) {
            return Long.parseLong(itemUri.getPathSegments().get(1));
        }
    }

    //private BeersContract() {
    //}
}

@@ -1118,24 +1118,220 @@
 on%22;%0A    %7D%0A%0A
+    interface FavoritesColumns%7B%0A        /** Type: INTEGER PRIMARY KEY AUTOINCREMENT */%0A        String _ID = %22_id%22;%0A        /** Type: INTEGER NOT NULL */%0A        String BEER_ID = %22beer_id%22;%0A    %7D%0A%0A
     public s
@@ -2409,47 +2409,1536 @@
   %7D%0A
-%0A    //private BeersContract() %7B%0A    //
+    public static class LikedItems implements FavoritesColumns %7B%0A        public static final String CONTENT_TYPE = %22vnd.android.cursor.dir/vnd.com.example.burcakdemircioglu.wannabeer.likeditems%22;%0A        public static final String CONTENT_ITEM_TYPE = %22vnd.android.cursor.item/vnd.com.example.burcakdemircioglu.wannabeer.likeditems%22;%0A%0A        public static final String DEFAULT_SORT = _ID + %22 ASC%22;%0A%0A        /**%0A         * Matches: /items/%0A         */%0A        public static Uri buildDirUri() %7B%0A            return BASE_URI.buildUpon().appendPath(%22likeditems%22).build();%0A        %7D%0A        /** Read item ID item detail URI. */%0A        public static long getItemId(Uri itemUri) %7B%0A            return Long.parseLong(itemUri.getPathSegments().get(1));%0A        %7D%0A    %7D%0A    public static class DislikedItems implements FavoritesColumns %7B%0A        public static final String CONTENT_TYPE = %22vnd.android.cursor.dir/vnd.com.example.burcakdemircioglu.wannabeer.dislikeditems%22;%0A        public static final String CONTENT_ITEM_TYPE = %22vnd.android.cursor.item/vnd.com.example.burcakdemircioglu.wannabeer.dislikeditems%22;%0A%0A        public static final String DEFAULT_SORT = _ID + %22 ASC%22;%0A%0A        /**%0A         * Matches: /items/%0A         */%0A        public static Uri buildDirUri() %7B%0A            return BASE_URI.buildUpon().appendPath(%22dislikeditems%22).build();%0A        %7D%0A        /** Read item ID item detail URI. */%0A        public static long getItemId(Uri itemUri) %7B%0A            return Long.parseLong(itemUri.getPathSegments().get(1));%0A        %7D%0A    
 %7D%0A%7D%0A

Create Favourites' Tables in Contract