Package org.apache.commons.lang3.builder

Examples of org.apache.commons.lang3.builder.CompareToBuilder


     * @see java.lang.Object#toString()
     */
    @Override
    public String toString()
    {
        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) //
            .append("selected", this.selected) //$NON-NLS-1$
            .append("number", this.number) //$NON-NLS-1$
            .toString();
    }
View Full Code Here


     * @see java.lang.Object#toString()
     */
    @Override
    public String toString()
    {
        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) //
            .append("firstPage", this.firstPage) //$NON-NLS-1$
            .append("lastPage", this.lastPage) //$NON-NLS-1$
            .append("currentPage", this.currentPage) //$NON-NLS-1$
            .append("nextPage", this.nextPage) //$NON-NLS-1$
            .append("previousPage", this.previousPage) //$NON-NLS-1$
View Full Code Here

     * @see java.lang.Object#toString()
     */
    @Override
    public String toString()
    {
        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) //
            .append("rowNumber", this.rowNumber) //$NON-NLS-1$
            .append("rowObject", this.rowObject) //$NON-NLS-1$
            .toString();
    }
View Full Code Here

         * @see java.lang.Object#toString()
         */
        @Override
        public String toString()
        {
            return new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE)
                .append("tagClass", this.tagClass)
                .append("attributeName", this.attributeName)
                .append("attributeType", this.attributeType)
                .toString();
        }
View Full Code Here

     * @see java.lang.Object#toString()
     */
    @Override
    public String toString()
    {
        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) //
            .append("cell", this.cell) //$NON-NLS-1$
            .append("header", this.header) //$NON-NLS-1$
            .append("htmlAttributes", this.htmlAttributes) //$NON-NLS-1$
            .append("stringValue", this.stringValue) //$NON-NLS-1$
            .toString();
View Full Code Here

     * @see java.lang.Object#toString()
     */
    @Override
    public String toString()
    {
        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("number", this.number).toString();
    }
View Full Code Here

     * @see java.lang.Object#toString()
     */
    @Override
    public String toString()
    {
        return new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE) //
            .append("project", this.project) //$NON-NLS-1$
            .append("amount", this.amount) //$NON-NLS-1$
            .append("city", this.city) //$NON-NLS-1$
            .append("task", this.task) //$NON-NLS-1$
            .toString();
View Full Code Here

         * @see java.lang.Object#toString()
         */
        @Override
        public String toString()
        {
            return new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE) //
                .append("name", this.itemName) //$NON-NLS-1$
                .append("email", this.itemEmail) //$NON-NLS-1$
                .toString();
        }
View Full Code Here

        assertEquals(baseStr + "[a=<size=0>]", new ToStringBuilder(base).append("a", (Object) new String[0], false).toString());
        assertEquals(baseStr + "[a={}]", new ToStringBuilder(base).append("a", (Object) new String[0], true).toString());
    }

    public void testPerson() {
        Person p = new Person();
        p.name = "John Doe";
        p.age = 33;
        p.smoker = false;
        String pBaseStr = p.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(p));
        assertEquals(pBaseStr + "[name=John Doe,age=33,smoker=false]", new ToStringBuilder(p).append("name", p.name).append("age", p.age).append("smoker", p.smoker).toString());
    }
View Full Code Here

        assertEquals("<size=0>", new ToStringBuilder(base).append("a", (Object) new String[0], false).toString());
        assertEquals("{}", new ToStringBuilder(base).append("a", (Object) new String[0], true).toString());
    }

    public void testPerson() {
        Person p = new Person();
        p.name = "Jane Q. Public";
        p.age = 47;
        p.smoker = false;
        assertEquals("Jane Q. Public,47,false", new ToStringBuilder(p).append("name", p.name).append("age", p.age).append("smoker", p.smoker).toString());
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.lang3.builder.CompareToBuilder

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.