Search in sources :

Example 1 with AppGroupGson

use of ai.elimu.model.gson.project.AppGroupGson in project webapp by elimu-ai.

the class JavaToGsonConverter method getAppGroupGson.

public static AppGroupGson getAppGroupGson(AppGroup appGroup) {
    if (appGroup == null) {
        return null;
    } else {
        AppGroupGson appGroupGson = new AppGroupGson();
        appGroupGson.setId(appGroup.getId());
        List<ApplicationGson> applications = new ArrayList<>();
        for (Application application : appGroup.getApplications()) {
            ApplicationGson applicationGson = getApplicationGson(application);
            applications.add(applicationGson);
        }
        appGroupGson.setApplications(applications);
        return appGroupGson;
    }
}
Also used : ArrayList(java.util.ArrayList) AppGroupGson(ai.elimu.model.gson.project.AppGroupGson) Application(ai.elimu.model.admin.Application) ApplicationGson(ai.elimu.model.gson.admin.ApplicationGson)

Example 2 with AppGroupGson

use of ai.elimu.model.gson.project.AppGroupGson in project webapp by elimu-ai.

the class JavaToGsonConverter method getAppCategoryGson.

public static AppCategoryGson getAppCategoryGson(AppCategory appCategory) {
    if (appCategory == null) {
        return null;
    } else {
        AppCategoryGson appCategoryGson = new AppCategoryGson();
        appCategoryGson.setId(appCategory.getId());
        appCategoryGson.setName(appCategory.getName());
        List<AppGroupGson> appGroups = new ArrayList<>();
        for (AppGroup appGroup : appCategory.getAppGroups()) {
            AppGroupGson appGroupGson = getAppGroupGson(appGroup);
            appGroups.add(appGroupGson);
        }
        appCategoryGson.setAppGroups(appGroups);
        return appCategoryGson;
    }
}
Also used : AppCategoryGson(ai.elimu.model.gson.project.AppCategoryGson) ArrayList(java.util.ArrayList) AppGroupGson(ai.elimu.model.gson.project.AppGroupGson) AppGroup(ai.elimu.model.project.AppGroup)

Aggregations

AppGroupGson (ai.elimu.model.gson.project.AppGroupGson)2 ArrayList (java.util.ArrayList)2 Application (ai.elimu.model.admin.Application)1 ApplicationGson (ai.elimu.model.gson.admin.ApplicationGson)1 AppCategoryGson (ai.elimu.model.gson.project.AppCategoryGson)1 AppGroup (ai.elimu.model.project.AppGroup)1