Search in sources :

Example 1 with CategoryHandler

use of org.hisp.dhis.android.core.category.CategoryHandler in project dhis2-android-sdk by dhis2.

the class HandlerFactory method createCategoryHandler.

public static CategoryHandler createCategoryHandler(DatabaseAdapter databaseAdapter) {
    CategoryStore categoryStore = new CategoryStoreImpl(databaseAdapter);
    CategoryOptionHandler categoryOptionHandler = createCategoryOptionHandler(databaseAdapter);
    CategoryCategoryOptionLinkStore categoryCategoryOptionLinkStore = new CategoryCategoryOptionLinkStoreImpl(databaseAdapter);
    CategoryHandler categoryHandler = new CategoryHandler(categoryStore, categoryOptionHandler, categoryCategoryOptionLinkStore);
    return categoryHandler;
}
Also used : CategoryOptionHandler(org.hisp.dhis.android.core.category.CategoryOptionHandler) CategoryCategoryOptionLinkStoreImpl(org.hisp.dhis.android.core.category.CategoryCategoryOptionLinkStoreImpl) CategoryStoreImpl(org.hisp.dhis.android.core.category.CategoryStoreImpl) CategoryStore(org.hisp.dhis.android.core.category.CategoryStore) CategoryCategoryOptionLinkStore(org.hisp.dhis.android.core.category.CategoryCategoryOptionLinkStore) CategoryHandler(org.hisp.dhis.android.core.category.CategoryHandler)

Example 2 with CategoryHandler

use of org.hisp.dhis.android.core.category.CategoryHandler in project dhis2-android-sdk by dhis2.

the class CategoryCallFactory method create.

@NonNull
public static CategoryEndpointCall create(Retrofit retrofit, DatabaseAdapter databaseAdapter) {
    CategoryService categoryService = retrofit.create(CategoryService.class);
    ResponseValidator<Category> categoryResponseValidator = new ResponseValidator<>();
    CategoryHandler categoryHandler = HandlerFactory.createCategoryHandler(databaseAdapter);
    ResourceHandler resourceHandler = HandlerFactory.createResourceHandler(databaseAdapter);
    CategoryQuery categoryQuery = CategoryQuery.defaultQuery();
    CategoryEndpointCall categoryEndpointCall = new CategoryEndpointCall(categoryQuery, categoryService, categoryResponseValidator, categoryHandler, resourceHandler, databaseAdapter, new Date());
    return categoryEndpointCall;
}
Also used : Category(org.hisp.dhis.android.core.category.Category) ResponseValidator(org.hisp.dhis.android.core.category.ResponseValidator) CategoryQuery(org.hisp.dhis.android.core.category.CategoryQuery) ResourceHandler(org.hisp.dhis.android.core.resource.ResourceHandler) CategoryService(org.hisp.dhis.android.core.category.CategoryService) CategoryEndpointCall(org.hisp.dhis.android.core.category.CategoryEndpointCall) CategoryHandler(org.hisp.dhis.android.core.category.CategoryHandler) Date(java.util.Date) NonNull(android.support.annotation.NonNull)

Aggregations

CategoryHandler (org.hisp.dhis.android.core.category.CategoryHandler)2 NonNull (android.support.annotation.NonNull)1 Date (java.util.Date)1 Category (org.hisp.dhis.android.core.category.Category)1 CategoryCategoryOptionLinkStore (org.hisp.dhis.android.core.category.CategoryCategoryOptionLinkStore)1 CategoryCategoryOptionLinkStoreImpl (org.hisp.dhis.android.core.category.CategoryCategoryOptionLinkStoreImpl)1 CategoryEndpointCall (org.hisp.dhis.android.core.category.CategoryEndpointCall)1 CategoryOptionHandler (org.hisp.dhis.android.core.category.CategoryOptionHandler)1 CategoryQuery (org.hisp.dhis.android.core.category.CategoryQuery)1 CategoryService (org.hisp.dhis.android.core.category.CategoryService)1 CategoryStore (org.hisp.dhis.android.core.category.CategoryStore)1 CategoryStoreImpl (org.hisp.dhis.android.core.category.CategoryStoreImpl)1 ResponseValidator (org.hisp.dhis.android.core.category.ResponseValidator)1 ResourceHandler (org.hisp.dhis.android.core.resource.ResourceHandler)1