title: Bloch's Builder Pattern with Spring
body: <p>I have numerous constructors inside one of my Classes so I thought it would be a good idea to to implement Bloch's "Builder Pattern" (see <a href="http://www.informit.com/articles/article.aspx?p=1216151&amp;seqNum=2" rel="nofollow">http://www.informit.com/articles/article.aspx?p=1216151&amp;seqNum=2</a>) for one of the Classes (Spring Project). </p>
  
  <p>It's quite possible, I have missed something as I am getting an "IllegalArgumentException" when running a Test Case against the Class. Does Spring allow for this type of stuff or shall I just opt for the conventional multiple constructor approach?</p>
  
  <pre><code>java.lang.IllegalArgumentException: No serializer found for class com.AllTweets$Builder and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: com.AllTweets["builder"])
  at org.codehaus.jackson.map.ObjectMapper._convert(ObjectMapper.java:2502)
  at org.codehaus.jackson.map.ObjectMapper.convertValue(ObjectMapper.java:2482)
  at org.springframework.data.redis.hash.JacksonHashMapper.toHash(JacksonHashMapper.java:52)
  at org.springframework.data.redis.hash.DecoratingStringHashMapper.toHash(DecoratingStringHashMapper.java:4
  ...
  </code></pre>
  
  <p>Class</p>
  
  <pre><code>public class AllTweets implements Serializable{
  ....
  
   public Builder getBuilder() {
       return new Builder();
      }
  
   public static class Builder {
          private AllTweets build;
  
          public Builder() {
              build = new AllTweets();
          }
          public Builder isTweet(Tweet tweet){
              build.id = tweet.getId();
              return this;
          }
          public Builder isRetweet(Retweet retweet){
              build.id = retweet.getId();
              return this;
          }
          public AllTweets build(){               
              return build;
          }
  //Acessors
       }
  </code></pre>