Search in sources :

Example 1 with ResponseValidator

use of org.hisp.dhis.android.core.category.ResponseValidator 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)

Example 2 with ResponseValidator

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

the class CategoryComboCallFactory method create.

@NonNull
public static CategoryComboEndpointCall create(Retrofit retrofit, DatabaseAdapter databaseAdapter) {
    CategoryComboService categoryComboService = retrofit.create(CategoryComboService.class);
    ResponseValidator<CategoryCombo> categoryComboResponseValidator = new ResponseValidator<>();
    CategoryComboHandler categoryComboHandler = HandlerFactory.createCategoryComboHandler(databaseAdapter);
    ResourceHandler resourceHandler = HandlerFactory.createResourceHandler(databaseAdapter);
    CategoryComboQuery categoryComboQuery = CategoryComboQuery.defaultQuery();
    CategoryComboEndpointCall categoryComboEndpointCall = new CategoryComboEndpointCall(categoryComboQuery, categoryComboService, categoryComboResponseValidator, categoryComboHandler, resourceHandler, databaseAdapter, new Date());
    return categoryComboEndpointCall;
}
Also used : ResponseValidator(org.hisp.dhis.android.core.category.ResponseValidator) CategoryCombo(org.hisp.dhis.android.core.category.CategoryCombo) CategoryComboService(org.hisp.dhis.android.core.category.CategoryComboService) ResourceHandler(org.hisp.dhis.android.core.resource.ResourceHandler) CategoryComboQuery(org.hisp.dhis.android.core.category.CategoryComboQuery) CategoryComboEndpointCall(org.hisp.dhis.android.core.category.CategoryComboEndpointCall) CategoryComboHandler(org.hisp.dhis.android.core.category.CategoryComboHandler) Date(java.util.Date) NonNull(android.support.annotation.NonNull)

Aggregations

NonNull (android.support.annotation.NonNull)2 Date (java.util.Date)2 ResponseValidator (org.hisp.dhis.android.core.category.ResponseValidator)2 ResourceHandler (org.hisp.dhis.android.core.resource.ResourceHandler)2 Category (org.hisp.dhis.android.core.category.Category)1 CategoryCombo (org.hisp.dhis.android.core.category.CategoryCombo)1 CategoryComboEndpointCall (org.hisp.dhis.android.core.category.CategoryComboEndpointCall)1 CategoryComboHandler (org.hisp.dhis.android.core.category.CategoryComboHandler)1 CategoryComboQuery (org.hisp.dhis.android.core.category.CategoryComboQuery)1 CategoryComboService (org.hisp.dhis.android.core.category.CategoryComboService)1 CategoryEndpointCall (org.hisp.dhis.android.core.category.CategoryEndpointCall)1 CategoryHandler (org.hisp.dhis.android.core.category.CategoryHandler)1 CategoryQuery (org.hisp.dhis.android.core.category.CategoryQuery)1 CategoryService (org.hisp.dhis.android.core.category.CategoryService)1