Package net.sourceforge.temply.base

Examples of net.sourceforge.temply.base.Category


    public void intersectCategories() {
        Collection<Category> cat1 = new ArrayList<Category>();
        Collection<Category> cat2 = new ArrayList<Category>();
        assertEquals(Collections.emptyList(), Utils.intersectCategories(cat1, cat2));
       
        cat1.add(new Category("db", "SqlServer"));
       
        assertEquals(1, Utils.intersectCategories(cat1, null).size());
       
        cat2.add(new Category("db", "SqlServer"));
       
        assertEquals(1, Utils.intersectCategories(cat1, cat2).size());
       
        cat2.add(new Category("Main"));
       
        assertEquals(2, Utils.intersectCategories(cat1, cat2).size());
       
        cat2.add(new Category("db", "Oracle"));
       
        assertEquals(2, Utils.intersectCategories(cat1, cat2).size());
       
        cat1.add(new Category("Repository"));
       
        assertEquals(0, Utils.intersectCategories(cat1, cat2).size());
       
    }
View Full Code Here


        for (String category : categories.split(",")) {
            String[] typeValue = category.split("\\:");
            if (typeValue.length == 0 || typeValue.length > 2) {
                throw new IllegalArgumentException("Unknows format for category \"" + category + "\".");
            } else if (typeValue.length == 1) {
                result.add(new Category(typeValue[0]));
            } else {
                result.add(new Category(typeValue[0], typeValue[1]));
            }
        }
        return result;
    }
View Full Code Here

        for (String category : categories) {
            String[] typeValue = category.split("\\:");
            if (typeValue.length == 0 || typeValue.length > 2) {
                throw new IllegalArgumentException("Unknows format for category \"" + category + "\".");
            } else if (typeValue.length == 1) {
                result.add(new Category(typeValue[0]));
            } else {
                result.add(new Category(typeValue[0], typeValue[1]));
            }
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.temply.base.Category

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.