/** * Add an array of Builder's to a {@link ContentBuilder} * * @param <D> Type of builder's generated object * @param builder ContentBuilder to add to * @param args Builder's to add * @return builder */ public static final <D> ContentBuilder<D> addContent( final ContentBuilder<D> builder, final Builder... args ) { for( Builder arg : args ) { builder.add( arg ); } return builder; }
@Override public ContentBuilder<D> add( final Builder builder ) { this.<ContentBuilder<D>> getBuilder().add( builder ); return this; } }
/** * Add an array of Objects's to a {@link ContentBuilder}. * * If an object is a {@link Builder} then it is added as-is. Otherwise * an appropriate builder is created for it prior to being added * * @param <D> Type of builder's generated object * @param builder ContentBuilder to add to * @param args Object's to add * @return builder */ public static final <D> ContentBuilder<D> addContent( final ContentBuilder<D> builder, final Collection<Object> args ) { for( Object arg : args ) { builder.add( getBuilder( arg ) ); } return builder; }
/** * Add an array of Objects's to a {@link ContentBuilder}. * * If an object is a {@link Builder} then it is added as-is. Otherwise * an appropriate builder is created for it prior to being added * * @param <D> Type of builder's generated object * @param builder ContentBuilder to add to * @param args Object's to add * @return builder */ public static final <D> ContentBuilder<D> addContent( final ContentBuilder<D> builder, final Object... args ) { for( Object arg : args ) { builder.add( getBuilder( arg ) ); } return builder; }