Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 10. Lang > Builder

Builder

Perhaps slightly misnamed, this package assists in the creation of Object.equals, Object.toString, Object.hashCode, and Comparable.compareTo methods. Generally speaking, each class (CompareToBuilder, EqualsBuilder, HashCodeBuilder, ReflectionToStringBuilder, and ToStringBuilder) allows you to construct an implementation via either select properties or via a reflection-based comparison. They can be used to quickly construct implementations.

The StandardToStringStyle and ToStringStyle classes can be used to create formatting rules, which can then be used to control the output of the new toString implementation.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial