Package com.sparc.knappsack.models

Examples of com.sparc.knappsack.models.ApplicationVersionStatisticSummaryModel


        return numRowsDeleted;
    }

    private List<ApplicationVersionStatisticSummaryModel> toApplicationVersionUserStatisticSummaryModel(List<ApplicationVersionUserStatistic> applicationVersionUserStatistics) {
        ApplicationVersionStatisticSummaryModel applicationVersionUserStatisticSummaryModel = new ApplicationVersionStatisticSummaryModel();
        List<ApplicationVersionStatisticSummaryModel> applicationVersionUserStatisticSummaryModelList = new CopyOnWriteArrayList<ApplicationVersionStatisticSummaryModel>();
        if (applicationVersionUserStatistics == null || applicationVersionUserStatistics.isEmpty()) {
            return applicationVersionUserStatisticSummaryModelList;
        }

        applicationVersionUserStatisticSummaryModel.setApplicationName(applicationVersionUserStatistics.get(0).getApplicationVersion().getApplication().getName());
        applicationVersionUserStatisticSummaryModel.setApplicationVersionId(applicationVersionUserStatistics.get(0).getApplicationVersion().getId());
        applicationVersionUserStatisticSummaryModel.setApplicationVersionName(applicationVersionUserStatistics.get(0).getApplicationVersion().getVersionName());
        applicationVersionUserStatisticSummaryModelList.add(applicationVersionUserStatisticSummaryModel);

        for (ApplicationVersionUserStatistic applicationVersionUserStatistic : applicationVersionUserStatistics) {
            boolean listHasStatistic = false;
            for (ApplicationVersionStatisticSummaryModel versionUserStatisticSummaryModel : applicationVersionUserStatisticSummaryModelList) {
                if (versionUserStatisticSummaryModel.getApplicationVersionId().equals(applicationVersionUserStatistic.getApplicationVersion().getId())) {
                    versionUserStatisticSummaryModel.setTotal(versionUserStatisticSummaryModel.getTotal() + 1);
                    listHasStatistic = true;
                    break;
                }
            }

            if (!listHasStatistic) {
                ApplicationVersionStatisticSummaryModel summaryModel = new ApplicationVersionStatisticSummaryModel();
                summaryModel.setTotal(1);
                summaryModel.setApplicationName(applicationVersionUserStatistic.getApplicationVersion().getApplication().getName());
                summaryModel.setApplicationVersionId(applicationVersionUserStatistic.getApplicationVersion().getId());
                summaryModel.setApplicationVersionName(applicationVersionUserStatistic.getApplicationVersion().getVersionName());
                applicationVersionUserStatisticSummaryModelList.add(summaryModel);
            }
        }

        return applicationVersionUserStatisticSummaryModelList;
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.models.ApplicationVersionStatisticSummaryModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.