Package com.sparc.knappsack.models

Examples of com.sparc.knappsack.models.RegionModel


        Domain domain = domainService.get(domainId);

        if (domain != null) {
            for (Region region : domain.getRegions()) {
                RegionModel model = regionService.createRegionModel(region);

                if (model != null) {
                    models.add(model);
                }
            }
View Full Code Here


            //Sort regions alphabetically in ascending order
            List<Region> sortedRegions = new ArrayList<Region>(domain.getRegions());
            Collections.sort(sortedRegions, new RegionNameComparator());
            for (Region region : sortedRegions) {
                RegionModel regionModel = regionService.createRegionModel(region);
                if (regionModel != null) {
                    regions.add(regionModel);
                }
            }
            model.addAttribute("regions", regions);
View Full Code Here

        return region;
    }

    @Override
    public RegionModel createRegionModel(Region region) {
        RegionModel model = null;

        if (region != null) {
            model = new RegionModel();

            model.setId(region.getId());
            model.setName(region.getName());
            List<String> emails = new ArrayList<String>(region.getEmails());
            Collections.sort(emails, String.CASE_INSENSITIVE_ORDER);
            model.getEmails().addAll(emails);
        }

        return model;
    }
View Full Code Here

TOP

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

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.