Package name.pehl.taoki.paging

Examples of name.pehl.taoki.paging.PageInfo


        String offset = form.getFirstValue(OFFSET);
        String pageSize = form.getFirstValue(PAGE_SIZE);

        int offsetValue = convertInt(offset, "Paging info contains the invalid offset: \"%s\"", offset);
        int pageSizeValue = convertInt(pageSize, "Paging info contains the invalid page size: \"%s\"", pageSize);
        return new PageInfo(offsetValue, pageSizeValue);
    }
View Full Code Here


            int offsetValue = convertInt(offset, "Paging info \"%s\" contains the invalid offset: \"%s\"", header,
                    offset);
            int lastIndexValue = convertInt(lastIndex, "Paging info \"%s\" contains the invalid last index: \"%s\"",
                    header, lastIndex);
            int pageSize = lastIndexValue - offsetValue + 1;
            return new PageInfo(offsetValue, pageSize);
        }
        else
        {
            String error = String.format("Paging info has the wrong format. Expected: %s, given: \"%s\"", REGEXP,
                    header);
View Full Code Here

        String offset = (String) attributes.get(OFFSET);
        String pageSize = (String) attributes.get(PAGE_SIZE);

        int offsetValue = convertInt(offset, "Paging info contains the invalid offset: \"%s\"", offset);
        int pageSizeValue = convertInt(pageSize, "Paging info contains the invalid page size: \"%s\"", pageSize);
        return new PageInfo(offsetValue, pageSizeValue);
    }
View Full Code Here


    @Test
    public void parseValid() throws PageInfoParseException
    {
        PageInfo pageInfo = null;

        pageInfo = underTest.parse("items=0-9");
        assertPageInfo(pageInfo, 0, 10);
    }
View Full Code Here


    @Test
    public void parseValid() throws PageInfoParseException
    {
        PageInfo pageInfo = null;

        pageInfo = underTest.parse(attributesFor(0, 10));
        assertPageInfo(pageInfo, 0, 10);
    }
View Full Code Here


    @Test
    public void parseValid() throws PageInfoParseException
    {
        PageInfo pageInfo = null;

        pageInfo = underTest.parse(formFor(0, 10));
        assertPageInfo(pageInfo, 0, 10);
    }
View Full Code Here


    @Test
    public void parseNull() throws PageInfoParseException
    {
        PageInfo pageInfo = underTest.parse(null);
        assertNull(pageInfo);
    }
View Full Code Here

TOP

Related Classes of name.pehl.taoki.paging.PageInfo

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.