FileDocCategorySizeDatePackage
BuilderBeanExample.javaAPI DocExample2581Wed May 18 09:39:00 BST 2005com.discursive.jccook.lang

BuilderBeanExample

public class BuilderBeanExample extends Object

Fields Summary
private static Logger
logger
private BuilderBean
builder
private BuilderBean
builder2
private BuilderBean
builder3
Constructors Summary
Methods Summary
protected voidinitialize()

        // Builder and Builder2 contain the same content
        builder = new BuilderBean();
        builder.setProp1("One");
        builder.setProp2("Two");

        builder2 = new BuilderBean();
        builder2.setProp1("One");
        builder2.setProp2("Two");

        builder3 = new BuilderBean();
        builder3.setProp1("Uno");
        builder3.setProp2("Dos");
    
public static voidmain(java.lang.String[] pArgs)

        BuilderBeanExample example = new BuilderBeanExample();
        example.initialize();
        example.testToString();
        example.testHashCode();
        example.testEquals();
        example.testCompare();
    
public voidtestCompare()

        logger.info(
            "builder compareTo builder2: " + builder.compareTo(builder2));
        logger.info(
            "builder compareTo builder3: " + builder.compareTo(builder3));
    
public voidtestEquals()

        logger.info("builder equals builder2: " + builder.equals(builder2));
        logger.info("builder equals builder3: " + builder.equals(builder3));
    
public voidtestHashCode()

        logger.info("HashCodeBuilder: " + builder.hashCode());
    
public voidtestToString()

        logger.info("ToStringBuilder: " + builder.toString());