private Post . Builder postFromResultSet ( final ResultSet rs ) throws SQLException { Post . Builder post = Post . newBuilder ( ) ; post . setId ( rs . getLong ( 1 ) ) ; post . setAuthorId ( rs . getLong ( 2 ) ) ; Timestamp ts = rs . getTimestamp ( 3 ) ; post . setPublishTimestamp ( ts != null ? ts . getTime ( ) : 0L ) ; post . setContent ( Strings . emptyToNull ( rs . getString ( 4 ) ) ) ; post . setTitle ( Strings . emptyToNull ( rs . getString ( 5 ) ) ) ; post . setExcerpt ( Strings . emptyToNull ( rs . getString ( 6 ) ) ) ; post . setStatus ( Post . Status . fromString ( rs . getString ( 7 ) ) ) ; post . setSlug ( Strings . emptyToNull ( rs . getString ( 8 ) ) ) ; ts = rs . getTimestamp ( 9 ) ; post . setModifiedTimestamp ( ts != null ? ts . getTime ( ) : 0L ) ; post . setParentId ( rs . getLong ( 10 ) ) ; post . setGUID ( Strings . emptyToNull ( rs . getString ( 11 ) ) ) ; post . setType ( Post . Type . fromString ( rs . getString ( 12 ) ) ) ; post . setMimeType ( rs . getString ( 13 ) ) ; return post ; }
Builds a post from a result set .