package com.box.boxandroidlibv2.jsonparsing;

import com.box.boxandroidlibv2.dao.BoxAndroidCollaboration;
import com.box.boxandroidlibv2.dao.BoxAndroidCollection;
import com.box.boxandroidlibv2.dao.BoxAndroidComment;
import com.box.boxandroidlibv2.dao.BoxAndroidEmailAlias;
import com.box.boxandroidlibv2.dao.BoxAndroidEvent;
import com.box.boxandroidlibv2.dao.BoxAndroidEventCollection;
import com.box.boxandroidlibv2.dao.BoxAndroidFile;
import com.box.boxandroidlibv2.dao.BoxAndroidFileVersion;
import com.box.boxandroidlibv2.dao.BoxAndroidFolder;
import com.box.boxandroidlibv2.dao.BoxAndroidOAuthData;
import com.box.boxandroidlibv2.dao.BoxAndroidUser;
import com.box.boxandroidlibv2.dao.BoxAndroidWebLink;
import com.box.boxjavalibv2.dao.BoxResourceType;
import com.box.boxjavalibv2.jsonparsing.BoxResourceHub;

/**
 * Resource hub to direct the parsing of the api responses into our android sdk data objects.
 */
public class AndroidBoxResourceHub extends BoxResourceHub {

    @SuppressWarnings("rawtypes")
    @Override
    public Class getClass(BoxResourceType type) {
        switch (type) {
            case FILE:
                return BoxAndroidFile.class;
            case FOLDER:
                return BoxAndroidFolder.class;
            case USER:
                return BoxAndroidUser.class;
            case FILE_VERSION:
                return BoxAndroidFileVersion.class;
            case COMMENT:
                return BoxAndroidComment.class;
            case COLLABORATION:
                return BoxAndroidCollaboration.class;
            case EMAIL_ALIAS:
                return BoxAndroidEmailAlias.class;
            case OAUTH_DATA:
                return BoxAndroidOAuthData.class;
            case WEB_LINK:
                return BoxAndroidWebLink.class;
            case EVENT:
                return BoxAndroidEvent.class;
            case ITEMS:
            case FILES:
            case USERS:
            case COMMENTS:
            case FILE_VERSIONS:
            case COLLABORATIONS:
            case EMAIL_ALIASES:
            case WEB_LINKS:
                return BoxAndroidCollection.class;
            case EVENTS:
                return BoxAndroidEventCollection.class;
            default:
                return super.getClass(type);
        }
    }
}

@@ -753,16 +753,65 @@
 ceType;%0A
+import com.box.boxjavalibv2.interfaces.IBoxType;%0A
 import c
@@ -1075,21 +1075,24 @@
 de%0A    p
-ublic
+rotected
  Class g
@@ -1097,25 +1097,45 @@
  get
-Class(BoxResource
+ObjectClassGivenConcreteIBoxType(IBox
 Type
@@ -1159,16 +1159,34 @@
 switch (
+(BoxResourceType) 
 type) %7B%0A

Make resourcehub easier to be extended on non BoxResourceType types.