From a66984ae4178c3610847b39cfe11d1a7783376ab Mon Sep 17 00:00:00 2001 From: Can Bican Date: Sat, 29 Jul 2017 21:50:34 +0300 Subject: [PATCH 1/2] lombok reductions. --- src/net/bican/wordpress/Attachment.java | 73 +--- src/net/bican/wordpress/Author.java | 70 +--- src/net/bican/wordpress/Cap.java | 72 +--- src/net/bican/wordpress/Comment.java | 246 +----------- src/net/bican/wordpress/CommentCount.java | 79 +--- .../bican/wordpress/CommentStatusList.java | 39 +- src/net/bican/wordpress/CustomField.java | 70 +--- src/net/bican/wordpress/Enclosure.java | 50 +-- src/net/bican/wordpress/FilterMediaItem.java | 67 +--- src/net/bican/wordpress/FilterPost.java | 100 +---- src/net/bican/wordpress/FilterUser.java | 101 +---- src/net/bican/wordpress/Labels.java | 252 +----------- src/net/bican/wordpress/Main.java | 4 +- src/net/bican/wordpress/MediaItem.java | 145 +------ .../bican/wordpress/MediaItemMetadata.java | 85 +--- src/net/bican/wordpress/MediaItemSize.java | 73 +--- src/net/bican/wordpress/MediaItemSizes.java | 70 +--- .../wordpress/MediaItemUploadResult.java | 70 +--- src/net/bican/wordpress/Option.java | 72 +--- src/net/bican/wordpress/Post.java | 368 +----------------- .../wordpress/PostThumbnailImageMeta.java | 175 +-------- src/net/bican/wordpress/PostType.java | 235 +---------- src/net/bican/wordpress/PostTypeCap.java | 236 +---------- src/net/bican/wordpress/Support.java | 177 ++------- src/net/bican/wordpress/Taxonomy.java | 146 +------ src/net/bican/wordpress/TermFilter.java | 100 +---- src/net/bican/wordpress/User.java | 199 +--------- src/net/bican/wordpress/UserBlog.java | 86 +--- src/net/bican/wordpress/Wordpress.java | 6 +- src/net/bican/wordpress/XmlRpcMapped.java | 88 ++--- .../PreferencesConfiguration.java | 9 +- 31 files changed, 256 insertions(+), 3307 deletions(-) diff --git a/src/net/bican/wordpress/Attachment.java b/src/net/bican/wordpress/Attachment.java index d57ce41..218b114 100644 --- a/src/net/bican/wordpress/Attachment.java +++ b/src/net/bican/wordpress/Attachment.java @@ -1,81 +1,22 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; + /** * Class that represents a wordpress attachment. * * @author Can Bican */ +@Getter +@Setter class Attachment extends XmlRpcMapped { byte[] bits; - String name; - Boolean overwrite; - String type; - - /** - * @return the bits - */ - public byte[] getBits() { - return this.bits; - } - - /** - * @return the name - */ - public String getName() { - return this.name; - } - - /** - * @return the overwrite - */ - public Boolean getOverwrite() { - return this.overwrite; - } - - /** - * @return the type - */ - public String getType() { - return this.type; - } - - /** - * @param bits - * the bits to set - */ - public void setBits(final byte[] bits) { - this.bits = bits; - } - - /** - * @param name - * the name to set - */ - public void setName(final String name) { - this.name = name; - } - - /** - * @param overwrite - * the overwrite to set - */ - public void setOverwrite(final Boolean overwrite) { - this.overwrite = overwrite; - } - - /** - * @param type - * the type to set - */ - public void setType(final String type) { - this.type = type; - } } diff --git a/src/net/bican/wordpress/Author.java b/src/net/bican/wordpress/Author.java index b1efe68..810003e 100644 --- a/src/net/bican/wordpress/Author.java +++ b/src/net/bican/wordpress/Author.java @@ -1,10 +1,11 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; import net.bican.wordpress.util.StringHeader; /** @@ -12,22 +13,13 @@ * * @author Can Bican */ +@Getter +@Setter public class Author extends XmlRpcMapped implements StringHeader { String display_name; - Integer user_id; - String user_login; - - /** - * Display Name of the author. - * - * @return the display_name - */ - public String getDisplay_name() { - return this.display_name; - } - + /** * (non-Javadoc) * @@ -38,52 +30,4 @@ public String getDisplay_name() { public String getStringHeader() { return "User_id:User_login:display_name"; } - - /** - * User id of the author. - * - * @return the user_id - */ - public Integer getUser_id() { - return this.user_id; - } - - /** - * Login name of the author. - * - * @return the user_login - */ - public String getUser_login() { - return this.user_login; - } - - /** - * Display name of the author. - * - * @param display_name - * the display_name to set - */ - public void setDisplay_name(final String display_name) { - this.display_name = display_name; - } - - /** - * User id of the author. - * - * @param user_id - * the user_id to set - */ - public void setUser_id(final Integer user_id) { - this.user_id = user_id; - } - - /** - * Login name of the author. - * - * @param user_login - * the user_login to set - */ - public void setUser_login(final String user_login) { - this.user_login = user_login; - } } diff --git a/src/net/bican/wordpress/Cap.java b/src/net/bican/wordpress/Cap.java index 2cf9f75..4862900 100644 --- a/src/net/bican/wordpress/Cap.java +++ b/src/net/bican/wordpress/Cap.java @@ -1,10 +1,11 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; import net.bican.wordpress.util.StringHeader; /** @@ -12,75 +13,16 @@ * * @author Can Bican */ +@Getter +@Setter public class Cap extends XmlRpcMapped implements StringHeader { String assign_terms; String delete_terms; String edit_terms; String manage_terms; - - /** - * @return the assign terms - */ - public String getAssign_terms() { - return this.assign_terms; - } - - /** - * @return the delete terms - */ - public String getDelete_terms() { - return this.delete_terms; - } - - /** - * @return edit terms - */ - public String getEdit_terms() { - return this.edit_terms; - } - - /** - * @return manage terms - */ - public String getManage_terms() { - return this.manage_terms; - } - + @Override public String getStringHeader() { return ""; //$NON-NLS-1$ } - - /** - * @param assign_terms - * the assign terms - */ - public void setAssign_terms(final String assign_terms) { - this.assign_terms = assign_terms; - } - - /** - * @param delete_terms - * the delete terms - */ - public void setDelete_terms(final String delete_terms) { - this.delete_terms = delete_terms; - } - - /** - * @param edit_terms - * the edit terms - */ - public void setEdit_terms(final String edit_terms) { - this.edit_terms = edit_terms; - } - - /** - * @param manage_terms - * the manage terms - */ - public void setManage_terms(final String manage_terms) { - this.manage_terms = manage_terms; - } - } diff --git a/src/net/bican/wordpress/Comment.java b/src/net/bican/wordpress/Comment.java index d935d22..b9910eb 100644 --- a/src/net/bican/wordpress/Comment.java +++ b/src/net/bican/wordpress/Comment.java @@ -1,7 +1,6 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; @@ -12,6 +11,8 @@ import java.io.IOException; import java.util.Date; +import lombok.Getter; +import lombok.Setter; import net.bican.wordpress.exceptions.InvalidPostFormatException; import net.bican.wordpress.util.FileParser; import net.bican.wordpress.util.StringHeader; @@ -22,20 +23,18 @@ * * @author Fred Potter */ +@Getter +@Setter public class Comment extends XmlRpcMapped implements StringHeader { - + /** * Creates a comment object from file * - * @param file - * input file + * @param file input file * @return new Comment object - * @throws FileNotFoundException - * when the file is absent - * @throws IOException - * when the file cannot be read - * @throws InvalidPostFormatException - * when the file format is invalid + * @throws FileNotFoundException when the file is absent + * @throws IOException when the file cannot be read + * @throws InvalidPostFormatException when the file format is invalid */ public static Comment fromFile(final File file) throws FileNotFoundException, IOException, InvalidPostFormatException { @@ -46,240 +45,27 @@ public static Comment fromFile(final File file) return result; } } - + String author; - String author_email; - String author_ip; - String author_url; - Integer comment_id; - String content; - Date date_created_gmt; - String link; - Integer parent; - Integer post_id; - String post_title; - String status; - Integer user_id; - - /** - * @return the author - */ - public String getAuthor() { - return this.author; - } - - /** - * @return the author_email - */ - public String getAuthor_email() { - return this.author_email; - } - - /** - * @return the author_ip - */ - public String getAuthor_ip() { - return this.author_ip; - } - - /** - * @return the author_url - */ - public String getAuthor_url() { - return this.author_url; - } - - /** - * @return the comment_id - */ - public Integer getComment_id() { - return this.comment_id; - } - - /** - * @return the content - */ - public String getContent() { - return this.content; - } - - /** - * @return the date_created_gmt - */ - public Date getDate_created_gmt() { - return this.date_created_gmt; - } - - /** - * @return the link - */ - public String getLink() { - return this.link; - } - - /** - * @return the parent - */ - public Integer getParent() { - return this.parent; - } - - /** - * @return the post_id - */ - public Integer getPost_id() { - return this.post_id; - } - - /** - * @return the post_title - */ - public String getPost_title() { - return this.post_title; - } - - /** - * @return the status - */ - public String getStatus() { - return this.status; - } - - /** - * (non-Javadoc) - * - * @see net.bican.wordpress.util.StringHeader#getStringHeader() - */ + @Override @SuppressWarnings("nls") public String getStringHeader() { final String TAB = ":"; - return "Date Created GMT" + TAB + "User Id" + TAB + "Comment Id" + TAB - + "Parent" + TAB + "Status" + TAB + "Content" + TAB + "Link" + TAB - + "Post Id" + TAB + "Post Title" + TAB + "Author" + TAB + "Author URL " - + TAB + "Author Email" + TAB + "Author IP"; - } - - /** - * @return the user_id - */ - public Integer getUser_id() { - return this.user_id; - } - - /** - * @param author - * the author to set - */ - public void setAuthor(final String author) { - this.author = author; - } - - /** - * @param authorEmail - * the author_email to set - */ - public void setAuthor_email(final String authorEmail) { - this.author_email = authorEmail; - } - - /** - * @param authorIp - * the author_ip to set - */ - public void setAuthor_ip(final String authorIp) { - this.author_ip = authorIp; - } - - /** - * @param authorUrl - * the author_url to set - */ - public void setAuthor_url(final String authorUrl) { - this.author_url = authorUrl; - } - - /** - * @param commentId - * the comment_id to set - */ - public void setComment_id(final Integer commentId) { - this.comment_id = commentId; - } - - /** - * @param content - * the content to set - */ - public void setContent(final String content) { - this.content = content; - } - - /** - * @param dateCreatedGmt - * the date_created_gmt to set - */ - public void setDate_created_gmt(final Date dateCreatedGmt) { - this.date_created_gmt = dateCreatedGmt; - } - - /** - * @param link - * the link to set - */ - public void setLink(final String link) { - this.link = link; - } - - /** - * @param parent - * the parent to set - */ - public void setParent(final Integer parent) { - this.parent = parent; - } - - /** - * @param postId - * the post_id to set - */ - public void setPost_id(final Integer postId) { - this.post_id = postId; - } - - /** - * @param postTitle - * the post_title to set - */ - public void setPost_title(final String postTitle) { - this.post_title = postTitle; - } - - /** - * @param status - * the status to set - */ - public void setStatus(final String status) { - this.status = status; - } - - /** - * @param userId - * the user_id to set - */ - public void setUser_id(final Integer userId) { - this.user_id = userId; + return "Date Created GMT" + TAB + "User Id" + TAB + "Comment Id" + TAB + "Parent" + TAB + + "Status" + TAB + "Content" + TAB + "Link" + TAB + "Post Id" + TAB + "Post Title" + TAB + + "Author" + TAB + "Author URL " + TAB + "Author Email" + TAB + "Author IP"; } } diff --git a/src/net/bican/wordpress/CommentCount.java b/src/net/bican/wordpress/CommentCount.java index 76a32c5..4616d8f 100644 --- a/src/net/bican/wordpress/CommentCount.java +++ b/src/net/bican/wordpress/CommentCount.java @@ -1,10 +1,11 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; import net.bican.wordpress.util.StringHeader; /** @@ -12,84 +13,18 @@ * * @author Fred Potter */ +@Getter +@Setter public class CommentCount extends XmlRpcMapped implements StringHeader { - Integer approved; Integer awaiting_moderation; Integer spam; Integer total_comments; - - /** - * @return Number of approved comments. - */ - public Integer getApproved() { - return this.approved; - } - - /** - * @return Number of comments awaiting moderation - */ - public Integer getAwaiting_moderation() { - return this.awaiting_moderation; - } - - /** - * @return Number of comments marked as spam. - */ - public Integer getSpam() { - return this.spam; - } - /** - * (non-Javadoc) - * - * @see net.bican.wordpress.util.StringHeader#getStringHeader() - */ @Override @SuppressWarnings("nls") public String getStringHeader() { final String TAB = ":"; - return "Approved" + TAB + "Awaiting Moderation" + TAB + "Spam" + TAB - + "Total Comments"; - } - - /** - * @return Total number of comments - */ - public Integer getTotal_comments() { - return this.total_comments; - } - - /** - * @param approved - * Sets number of approved comments. - */ - public void setApproved(final Integer approved) { - this.approved = approved; + return "Approved" + TAB + "Awaiting Moderation" + TAB + "Spam" + TAB + "Total Comments"; } - - /** - * @param awaitingModeration - * Number of comments awaiting moderation. - */ - public void setAwaiting_moderation(final Integer awaitingModeration) { - this.awaiting_moderation = awaitingModeration; - } - - /** - * @param spam - * Number of comments that are spam - */ - public void setSpam(final Integer spam) { - this.spam = spam; - } - - /** - * @param totalComments - * Total number of comments. - */ - public void setTotal_comments(final Integer totalComments) { - this.total_comments = totalComments; - } - } diff --git a/src/net/bican/wordpress/CommentStatusList.java b/src/net/bican/wordpress/CommentStatusList.java index 4ece687..83a61df 100644 --- a/src/net/bican/wordpress/CommentStatusList.java +++ b/src/net/bican/wordpress/CommentStatusList.java @@ -1,10 +1,11 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; import net.bican.wordpress.util.StringHeader; /** @@ -12,45 +13,17 @@ * * @author Can Bican */ +@Getter +@Setter public class CommentStatusList extends XmlRpcMapped implements StringHeader { - String approve; - String hold; - String spam; - /** - * @return approved description - */ - public String getApprove() { - return this.approve; - } - - /** - * @return hold description - */ - public String getHold() { - return this.hold; - } - - /** - * @return spam description - */ - public String getSpam() { - return this.spam; - } - - /** - * (non-Javadoc) - * - * @see net.bican.wordpress.util.StringHeader#getStringHeader() - */ @Override @SuppressWarnings("nls") public String getStringHeader() { final String TAB = ":"; return "Name" + TAB + "Description"; } - } diff --git a/src/net/bican/wordpress/CustomField.java b/src/net/bican/wordpress/CustomField.java index dd82a8d..3586d8f 100644 --- a/src/net/bican/wordpress/CustomField.java +++ b/src/net/bican/wordpress/CustomField.java @@ -1,12 +1,13 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; import org.json.JSONObject; +import lombok.Getter; +import lombok.Setter; import net.bican.wordpress.util.StringHeader; /** @@ -14,75 +15,20 @@ * * @author alok */ +@Getter +@Setter public class CustomField extends XmlRpcMapped implements StringHeader { String id = null; - String key = null; - String value = null; - - /** - * @return id of custom field - */ - public String getId() { - return this.id; - } - - /** - * @return key of custom field - */ - public String getKey() { - return this.key; - } - - /** - * (non-Javadoc) - * - * @see net.bican.wordpress.util.StringHeader#getStringHeader() - */ + @Override @SuppressWarnings("nls") public String getStringHeader() { final String TAB = ":"; return "Id" + TAB + "Key" + TAB + "Value"; } - - /** - * @return value of custom field - */ - public String getValue() { - return this.value; - } - - /** - * @param id - * id to set - */ - public void setId(final String id) { - this.id = id; - } - - /** - * @param key - * key to set - */ - public void setKey(final String key) { - this.key = key; - } - - /** - * @param value - * the value to set - */ - public void setValue(final String value) { - this.value = value; - } - - /** - * (non-Javadoc) - * - * @see net.bican.wordpress.XmlRpcMapped#toString() - */ + @SuppressWarnings("nls") @Override public String toString() { diff --git a/src/net/bican/wordpress/Enclosure.java b/src/net/bican/wordpress/Enclosure.java index 7e1aa7f..ec4b430 100644 --- a/src/net/bican/wordpress/Enclosure.java +++ b/src/net/bican/wordpress/Enclosure.java @@ -5,58 +5,18 @@ */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; + /** * Enclosure data in a post * * @author Can Bican */ +@Getter +@Setter public class Enclosure extends XmlRpcMapped { Integer length; String type; String url; - - /** - * @return the length - */ - public final Integer getLength() { - return this.length; - } - - /** - * @return the type - */ - public final String getType() { - return this.type; - } - - /** - * @return the url - */ - public final String getUrl() { - return this.url; - } - - /** - * @param length - * the length to set - */ - public final void setLength(final Integer length) { - this.length = length; - } - - /** - * @param type - * the type to set - */ - public final void setType(final String type) { - this.type = type; - } - - /** - * @param url - * the url to set - */ - public final void setUrl(final String url) { - this.url = url; - } } diff --git a/src/net/bican/wordpress/FilterMediaItem.java b/src/net/bican/wordpress/FilterMediaItem.java index 3fbc553..f51e94a 100644 --- a/src/net/bican/wordpress/FilterMediaItem.java +++ b/src/net/bican/wordpress/FilterMediaItem.java @@ -5,74 +5,19 @@ */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; + /** * Class for filtering media library result * * @author Can Bican */ +@Getter +@Setter public class FilterMediaItem extends XmlRpcMapped { String mime_type; Integer number; Integer offset; - Integer parent_id; - - /** - * @return the mime_type - */ - public final String getMime_type() { - return this.mime_type; - } - - /** - * @return the number - */ - public final Integer getNumber() { - return this.number; - } - - /** - * @return the offset - */ - public final Integer getOffset() { - return this.offset; - } - - /** - * @return the parent_id - */ - public final Integer getParent_id() { - return this.parent_id; - } - - /** - * @param mime_type - * the mime_type to set - */ - public final void setMime_type(final String mime_type) { - this.mime_type = mime_type; - } - - /** - * @param number - * the number to set - */ - public final void setNumber(final Integer number) { - this.number = number; - } - - /** - * @param offset - * the offset to set - */ - public final void setOffset(final Integer offset) { - this.offset = offset; - } - - /** - * @param parent_id - * the parent_id to set - */ - public final void setParent_id(final Integer parent_id) { - this.parent_id = parent_id; - } + Integer parent_id; } diff --git a/src/net/bican/wordpress/FilterPost.java b/src/net/bican/wordpress/FilterPost.java index 27d9e24..e995916 100644 --- a/src/net/bican/wordpress/FilterPost.java +++ b/src/net/bican/wordpress/FilterPost.java @@ -1,15 +1,19 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; + /** * Filter for retrieving posts * * @author Can Bican */ +@Getter +@Setter public class FilterPost extends XmlRpcMapped { Integer number; Integer offset; @@ -17,94 +21,4 @@ public class FilterPost extends XmlRpcMapped { String orderby; String post_status; String post_type; - - /** - * @return the number - */ - public final Integer getNumber() { - return this.number; - } - - /** - * @return the offset - */ - public final Integer getOffset() { - return this.offset; - } - - /** - * @return the order - */ - public final String getOrder() { - return this.order; - } - - /** - * @return the orderby - */ - public final String getOrderby() { - return this.orderby; - } - - /** - * @return the post_status - */ - public final String getPost_status() { - return this.post_status; - } - - /** - * @return the post_type - */ - public final String getPost_type() { - return this.post_type; - } - - /** - * @param number - * the number to set - */ - public final void setNumber(final Integer number) { - this.number = number; - } - - /** - * @param offset - * the offset to set - */ - public final void setOffset(final Integer offset) { - this.offset = offset; - } - - /** - * @param order - * the order to set - */ - public final void setOrder(final String order) { - this.order = order; - } - - /** - * @param orderby - * the orderby to set - */ - public final void setOrderby(final String orderby) { - this.orderby = orderby; - } - - /** - * @param post_status - * the post_status to set - */ - public final void setPost_status(final String post_status) { - this.post_status = post_status; - } - - /** - * @param post_type - * the post_type to set - */ - public final void setPost_type(final String post_type) { - this.post_type = post_type; - } } diff --git a/src/net/bican/wordpress/FilterUser.java b/src/net/bican/wordpress/FilterUser.java index 849fed9..6a82082 100644 --- a/src/net/bican/wordpress/FilterUser.java +++ b/src/net/bican/wordpress/FilterUser.java @@ -1,10 +1,11 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; import redstone.xmlrpc.XmlRpcStruct; /** @@ -12,6 +13,8 @@ * * @author Can Bican */ +@Getter +@Setter public class FilterUser { Integer number; Integer offset; @@ -19,7 +22,7 @@ public class FilterUser { String orderby; String role; String who; - + /** * @return only with non-null values */ @@ -46,94 +49,4 @@ public XmlRpcStruct buildWithNonNullValues() { } return r; } - - /** - * @return the number - */ - public final Integer getNumber() { - return this.number; - } - - /** - * @return the offset - */ - public final Integer getOffset() { - return this.offset; - } - - /** - * @return the order - */ - public final String getOrder() { - return this.order; - } - - /** - * @return the orderby - */ - public final String getOrderby() { - return this.orderby; - } - - /** - * @return the role - */ - public final String getRole() { - return this.role; - } - - /** - * @return the who - */ - public final String getWho() { - return this.who; - } - - /** - * @param number - * the number to set - */ - public final void setNumber(final Integer number) { - this.number = number; - } - - /** - * @param offset - * the offset to set - */ - public final void setOffset(final Integer offset) { - this.offset = offset; - } - - /** - * @param order - * the order to set - */ - public final void setOrder(final String order) { - this.order = order; - } - - /** - * @param orderby - * the orderby to set - */ - public final void setOrderby(final String orderby) { - this.orderby = orderby; - } - - /** - * @param role - * the role to set - */ - public final void setRole(final String role) { - this.role = role; - } - - /** - * @param who - * the who to set - */ - public final void setWho(final String who) { - this.who = who; - } } diff --git a/src/net/bican/wordpress/Labels.java b/src/net/bican/wordpress/Labels.java index 1a2727e..8278fd2 100644 --- a/src/net/bican/wordpress/Labels.java +++ b/src/net/bican/wordpress/Labels.java @@ -1,10 +1,11 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; import net.bican.wordpress.util.StringHeader; /** @@ -12,6 +13,8 @@ * * @author Can Bican */ +@Getter +@Setter public class Labels extends XmlRpcMapped implements StringHeader { String add_new_item; String add_or_remove_items; @@ -29,250 +32,9 @@ public class Labels extends XmlRpcMapped implements StringHeader { String singular_name; String update_item; String view_item; - - /** - * @return the add new item text - */ - public String getAdd_new_item() { - return this.add_new_item; - } - - /** - * @return the add or remove items text - */ - public String getAdd_or_remove_items() { - return this.add_or_remove_items; - } - - /** - * @return the all items text - */ - public String getAll_items() { - return this.all_items; - } - - /** - * @return the choose from most used text - */ - public String getChoose_from_most_used() { - return this.choose_from_most_used; - } - - /** - * @return the edit item text - */ - public String getEdit_item() { - return this.edit_item; - } - - /** - * @return the name - */ - public String getName() { - return this.name; - } - - /** - * @return the new item name text - */ - public String getNew_item_name() { - return this.new_item_name; - } - - /** - * @return the not found text - */ - public String getNot_found() { - return this.not_found; - } - - /** - * @return the parent item text - */ - public String getParent_item() { - return this.parent_item; - } - - /** - * @return the parent item colon text - */ - public String getParent_item_colon() { - return this.parent_item_colon; - } - - /** - * @return the popular items text - */ - public String getPopular_items() { - return this.popular_items; - } - - /** - * @return the search items text - */ - public String getSearch_items() { - return this.search_items; - } - - /** - * @return the separate items with commas text - */ - public String getSeparate_items_with_commas() { - return this.separate_items_with_commas; - } - - /** - * @return the singular name text - */ - public String getSingular_name() { - return this.singular_name; - } - + @Override public String getStringHeader() { return ""; //$NON-NLS-1$ } - - /** - * @return the update item text - */ - public String getUpdate_item() { - return this.update_item; - } - - /** - * @return the view item text - */ - public String getView_item() { - return this.view_item; - } - - /** - * @param add_new_item - * add new item text to set - */ - public void setAdd_new_item(final String add_new_item) { - this.add_new_item = add_new_item; - } - - /** - * @param add_or_remove_items - * add or remove items text to set - */ - public void setAdd_or_remove_items(final String add_or_remove_items) { - this.add_or_remove_items = add_or_remove_items; - } - - /** - * @param all_items - * all items text to set - */ - public void setAll_items(final String all_items) { - this.all_items = all_items; - } - - /** - * @param choose_from_most_used - * choose from most used text to set - */ - public void setChoose_from_most_used(final String choose_from_most_used) { - this.choose_from_most_used = choose_from_most_used; - } - - /** - * @param edit_item - * edit item text to set - */ - public void setEdit_item(final String edit_item) { - this.edit_item = edit_item; - } - - /** - * @param name - * name to set - */ - public void setName(final String name) { - this.name = name; - } - - /** - * @param new_item_name - * new item name text to set - */ - public void setNew_item_name(final String new_item_name) { - this.new_item_name = new_item_name; - } - - /** - * @param not_found - * not found text to set - */ - public void setNot_found(final String not_found) { - this.not_found = not_found; - } - - /** - * @param parent_item - * parent item text to set - */ - public void setParent_item(final String parent_item) { - this.parent_item = parent_item; - } - - /** - * @param parent_item_colon - * parent item colon text to set - */ - public void setParent_item_colon(final String parent_item_colon) { - this.parent_item_colon = parent_item_colon; - } - - /** - * @param popular_items - * popular items text to set - */ - public void setPopular_items(final String popular_items) { - this.popular_items = popular_items; - } - - /** - * @param search_items - * search items text to set - */ - public void setSearch_items(final String search_items) { - this.search_items = search_items; - } - - /** - * @param separate_items_with_commas - * separate items with commas text to set - */ - public void setSeparate_items_with_commas( - final String separate_items_with_commas) { - this.separate_items_with_commas = separate_items_with_commas; - } - - /** - * @param singular_name - * singular name to set - */ - public void setSingular_name(final String singular_name) { - this.singular_name = singular_name; - } - - /** - * @param update_item - * update item text to set - */ - public void setUpdate_item(final String update_item) { - this.update_item = update_item; - } - - /** - * @param view_item - * view item text to set - */ - public void setView_item(final String view_item) { - this.view_item = view_item; - } } diff --git a/src/net/bican/wordpress/Main.java b/src/net/bican/wordpress/Main.java index 2472ce0..2b9309f 100644 --- a/src/net/bican/wordpress/Main.java +++ b/src/net/bican/wordpress/Main.java @@ -32,7 +32,7 @@ */ public class Main { private static void delete(final Options options, final WpCliConfiguration config, - final Wordpress wp, final String opt, final boolean deletePage) + final Wordpress wp, final String opt, @SuppressWarnings("unused") final boolean deletePage) throws XmlRpcFault, InsufficientRightsException, ObjectNotFoundException { final Integer post_ID = getInteger(opt, config); if (post_ID != null) { @@ -55,7 +55,7 @@ private static void deleteComment(final Wordpress wp, final int commentID) @SuppressWarnings({"nls"}) private static void edit(final Options options, final WpCliConfiguration config, - final Wordpress wp, final String opt, final boolean isPage) + final Wordpress wp, final String opt, @SuppressWarnings("unused") final boolean isPage) throws IOException, InvalidPostFormatException, XmlRpcFault, InsufficientRightsException, InvalidArgumentsException, ObjectNotFoundException { final Integer post_ID = getInteger("postid", config); diff --git a/src/net/bican/wordpress/MediaItem.java b/src/net/bican/wordpress/MediaItem.java index b2dbbdb..88b21d8 100644 --- a/src/net/bican/wordpress/MediaItem.java +++ b/src/net/bican/wordpress/MediaItem.java @@ -1,17 +1,21 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; import java.util.Date; +import lombok.Getter; +import lombok.Setter; + /** * Class for an media item object for a blog * * @author Can Bican */ +@Getter +@Setter public class MediaItem extends XmlRpcMapped { Integer attachment_id; String caption; @@ -22,139 +26,4 @@ public class MediaItem extends XmlRpcMapped { Integer parent; String thumbnail; String title; - - /** - * @return the attachment_id - */ - public final Integer getAttachment_id() { - return this.attachment_id; - } - - /** - * @return the caption - */ - public final String getCaption() { - return this.caption; - } - - /** - * @return the date_created_gmt - */ - public final Date getDate_created_gmt() { - return this.date_created_gmt; - } - - /** - * @return the description - */ - public final String getDescription() { - return this.description; - } - - /** - * @return the link - */ - public final String getLink() { - return this.link; - } - - /** - * @return the metadata - */ - public final MediaItemMetadata getMetadata() { - return this.metadata; - } - - /** - * @return the parent - */ - public final Integer getParent() { - return this.parent; - } - - /** - * @return the thumbnail - */ - public final String getThumbnail() { - return this.thumbnail; - } - - /** - * @return the title - */ - public final String getTitle() { - return this.title; - } - - /** - * @param attachment_id - * the attachment_id to set - */ - public final void setAttachment_id(final Integer attachment_id) { - this.attachment_id = attachment_id; - } - - /** - * @param caption - * the caption to set - */ - public final void setCaption(final String caption) { - this.caption = caption; - } - - /** - * @param date_created_gmt - * the date_created_gmt to set - */ - public final void setDate_created_gmt(final Date date_created_gmt) { - this.date_created_gmt = date_created_gmt; - } - - /** - * @param description - * the description to set - */ - public final void setDescription(final String description) { - this.description = description; - } - - /** - * @param link - * the link to set - */ - public final void setLink(final String link) { - this.link = link; - } - - /** - * @param metadata - * the metadata to set - */ - public final void setMetadata(final MediaItemMetadata metadata) { - this.metadata = metadata; - } - - /** - * @param parent - * the parent to set - */ - public final void setParent(final Integer parent) { - this.parent = parent; - } - - /** - * @param thumbnail - * the thumbnail to set - */ - public final void setThumbnail(final String thumbnail) { - this.thumbnail = thumbnail; - } - - /** - * @param title - * the title to set - */ - public final void setTitle(final String title) { - this.title = title; - } } diff --git a/src/net/bican/wordpress/MediaItemMetadata.java b/src/net/bican/wordpress/MediaItemMetadata.java index de39600..db6fca2 100644 --- a/src/net/bican/wordpress/MediaItemMetadata.java +++ b/src/net/bican/wordpress/MediaItemMetadata.java @@ -1,94 +1,23 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; + /** * Meta data of a media object in a MediaItem class * * @author Can Bican */ +@Getter +@Setter public class MediaItemMetadata extends XmlRpcMapped { String file; Integer height; PostThumbnailImageMeta image_meta; MediaItemSizes sizes; Integer width; - - /** - * @return the file - */ - public final String getFile() { - return this.file; - } - - /** - * @return the height - */ - public final Integer getHeight() { - return this.height; - } - - /** - * @return the image_meta - */ - public final PostThumbnailImageMeta getImage_meta() { - return this.image_meta; - } - - /** - * @return the sizes - */ - public final MediaItemSizes getSizes() { - return this.sizes; - } - - /** - * @return the width - */ - public final Integer getWidth() { - return this.width; - } - - /** - * @param file - * the file to set - */ - public final void setFile(final String file) { - this.file = file; - } - - /** - * @param height - * the height to set - */ - public final void setHeight(final Integer height) { - this.height = height; - } - - /** - * @param image_meta - * the image_meta to set - */ - public final void setImage_meta(final PostThumbnailImageMeta image_meta) { - this.image_meta = image_meta; - } - - /** - * @param sizes - * the sizes to set - */ - public final void setSizes(final MediaItemSizes sizes) { - this.sizes = sizes; - } - - /** - * @param width - * the width to set - */ - public final void setWidth(final Integer width) { - this.width = width; - } } diff --git a/src/net/bican/wordpress/MediaItemSize.java b/src/net/bican/wordpress/MediaItemSize.java index d538bc4..8f50179 100644 --- a/src/net/bican/wordpress/MediaItemSize.java +++ b/src/net/bican/wordpress/MediaItemSize.java @@ -1,10 +1,11 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; import redstone.xmlrpc.XmlRpcStruct; /** @@ -12,79 +13,21 @@ * * @author Can Bican */ +@Getter +@Setter public class MediaItemSize extends XmlRpcMapped { private static final String MIME_TYPE_FIELD = "mime-type"; //$NON-NLS-1$ String file; Integer height; String mimeType; Integer width; - + @Override public void fromXmlRpcStruct(final XmlRpcStruct x) { super.fromXmlRpcStruct(x); this.setMimeType((String) x.get(MIME_TYPE_FIELD)); } - - /** - * @return the file - */ - public final String getFile() { - return this.file; - } - - /** - * @return the height - */ - public final Integer getHeight() { - return this.height; - } - - /** - * @return the mimeType - */ - public final String getMimeType() { - return this.mimeType; - } - - /** - * @return the width - */ - public final Integer getWidth() { - return this.width; - } - - /** - * @param file - * the file to set - */ - public final void setFile(final String file) { - this.file = file; - } - - /** - * @param height - * the height to set - */ - public final void setHeight(final Integer height) { - this.height = height; - } - - /** - * @param mimeType - * the mimeType to set - */ - public final void setMimeType(final String mimeType) { - this.mimeType = mimeType; - } - - /** - * @param width - * the width to set - */ - public final void setWidth(final Integer width) { - this.width = width; - } - + @SuppressWarnings("unchecked") @Override public XmlRpcStruct toXmlRpcStruct() { diff --git a/src/net/bican/wordpress/MediaItemSizes.java b/src/net/bican/wordpress/MediaItemSizes.java index 72547cd..5b5ef83 100644 --- a/src/net/bican/wordpress/MediaItemSizes.java +++ b/src/net/bican/wordpress/MediaItemSizes.java @@ -1,78 +1,22 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; + /** * Class that keeps info for different sizes of a media item * * @author Can Bican */ +@Getter +@Setter public class MediaItemSizes extends XmlRpcMapped { MediaItemSize large; MediaItemSize medium; MediaItemSize post_thumbnail; MediaItemSize thumbnail; - - /** - * @return the large - */ - public final MediaItemSize getLarge() { - return this.large; - } - - /** - * @return the medium - */ - public final MediaItemSize getMedium() { - return this.medium; - } - - /** - * @return the post_thumbnail - */ - public final MediaItemSize getPost_thumbnail() { - return this.post_thumbnail; - } - - /** - * @return the thumbnail - */ - public final MediaItemSize getThumbnail() { - return this.thumbnail; - } - - /** - * @param large - * the large to set - */ - public final void setLarge(final MediaItemSize large) { - this.large = large; - } - - /** - * @param medium - * the medium to set - */ - public final void setMedium(final MediaItemSize medium) { - this.medium = medium; - } - - /** - * @param post_thumbnail - * the post_thumbnail to set - */ - public final void setPost_thumbnail(final MediaItemSize post_thumbnail) { - this.post_thumbnail = post_thumbnail; - } - - /** - * @param thumbnail - * the thumbnail to set - */ - public final void setThumbnail(final MediaItemSize thumbnail) { - this.thumbnail = thumbnail; - } } diff --git a/src/net/bican/wordpress/MediaItemUploadResult.java b/src/net/bican/wordpress/MediaItemUploadResult.java index 3eff266..fce5c98 100644 --- a/src/net/bican/wordpress/MediaItemUploadResult.java +++ b/src/net/bican/wordpress/MediaItemUploadResult.java @@ -1,78 +1,22 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; + /** * Represents the result of an uploadFile() * * @author Can Bican */ +@Getter +@Setter public class MediaItemUploadResult extends XmlRpcMapped { String file; Integer id; String type; String url; - - /** - * @return the file - */ - public final String getFile() { - return this.file; - } - - /** - * @return the id - */ - public final Integer getId() { - return this.id; - } - - /** - * @return the type - */ - public final String getType() { - return this.type; - } - - /** - * @return the url - */ - public final String getUrl() { - return this.url; - } - - /** - * @param file - * the file to set - */ - public final void setFile(final String file) { - this.file = file; - } - - /** - * @param id - * the id to set - */ - public final void setId(final Integer id) { - this.id = id; - } - - /** - * @param type - * the type to set - */ - public final void setType(final String type) { - this.type = type; - } - - /** - * @param url - * the url to set - */ - public final void setUrl(final String url) { - this.url = url; - } } diff --git a/src/net/bican/wordpress/Option.java b/src/net/bican/wordpress/Option.java index c07f06d..206af27 100644 --- a/src/net/bican/wordpress/Option.java +++ b/src/net/bican/wordpress/Option.java @@ -1,10 +1,11 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; import net.bican.wordpress.util.StringHeader; /** @@ -12,75 +13,16 @@ * * @author Can Bican */ +@Getter +@Setter public class Option extends XmlRpcMapped implements StringHeader { String desc; String name; Boolean readonly; String value; - - /** - * @return the description - */ - public String getDesc() { - return this.desc; - } - - /** - * @return the name - */ - public String getName() { - return this.name; - } - + @Override public String getStringHeader() { return ""; //$NON-NLS-1$ } - - /** - * @return the value - */ - public String getValue() { - return this.value; - } - - /** - * @return read-only status - */ - public Boolean isReadonly() { - return this.readonly; - } - - /** - * @param desc - * description to set - */ - public void setDesc(final String desc) { - this.desc = desc; - } - - /** - * @param name - * name to set - */ - public void setName(final String name) { - this.name = name; - } - - /** - * @param readonly - * read-only status to set - */ - public void setReadonly(final Boolean readonly) { - this.readonly = readonly; - } - - /** - * @param value - * value to set - */ - public void setValue(final String value) { - this.value = value; - } - } diff --git a/src/net/bican/wordpress/Post.java b/src/net/bican/wordpress/Post.java index 06655bf..4cb4585 100644 --- a/src/net/bican/wordpress/Post.java +++ b/src/net/bican/wordpress/Post.java @@ -12,6 +12,8 @@ import java.util.Date; import java.util.List; +import lombok.Getter; +import lombok.Setter; import net.bican.wordpress.exceptions.InvalidPostFormatException; import net.bican.wordpress.util.FileParser; import redstone.xmlrpc.XmlRpcStruct; @@ -21,6 +23,8 @@ * * @author Can Bican */ +@Getter +@Setter public class Post extends XmlRpcMapped { /** * creates a post object from file @@ -76,370 +80,12 @@ public XmlRpcStruct toXmlRpcStruct() { String post_title; String post_type; Boolean sticky; - List terms; /** - * @return the comment_status - */ - public final String getComment_status() { - return this.comment_status; - } - - /** - * @return the customFields - */ - public final List getCustom_fields() { - return this.custom_fields; - } - - /** - * @return the enclosure - */ - public final Enclosure getEnclosure() { - return this.enclosure; - } - - /** - * @return the guid - */ - public final String getGuid() { - return this.guid; - } - - /** - * @return the link - */ - public final String getLink() { - return this.link; - } - - /** - * @return the menu_order - */ - public final Integer getMenu_order() { - return this.menu_order; - } - - /** - * @return the ping_status - */ - public final String getPing_status() { - return this.ping_status; - } - - /** - * @return the post_author - */ - public final Integer getPost_author() { - return this.post_author; - } - - /** - * @return the post_content - */ - public final String getPost_content() { - return this.post_content; - } - - /** - * @return the post_date - */ - public final Date getPost_date() { - return this.post_date; - } - - /** - * @return the post_date_gmt - */ - public final Date getPost_date_gmt() { - return this.post_date_gmt; - } - - /** - * @return the post_excerpt - */ - public final String getPost_excerpt() { - return this.post_excerpt; - } - - /** - * @return the post_format - */ - public final String getPost_format() { - return this.post_format; - } - - /** - * @return the post_id - */ - public final Integer getPost_id() { - return this.post_id; - } - - /** - * @return the post_mime_type - */ - public final String getPost_mime_type() { - return this.post_mime_type; - } - - /** - * @return the post_modified - */ - public final Date getPost_modified() { - return this.post_modified; - } - - /** - * @return the post_modified_gmt - */ - public final Date getPost_modified_gmt() { - return this.post_modified_gmt; - } - - /** - * @return the post_name - */ - public final String getPost_name() { - return this.post_name; - } - - /** - * @return the post_parent - */ - public final Integer getPost_parent() { - return this.post_parent; - } - - /** - * @return the post_password - */ - public final String getPost_password() { - return this.post_password; - } - - /** - * @return the post_status - */ - public final String getPost_status() { - return this.post_status; - } - - /** - * @return the post_thumbnail - */ - public final MediaItem getPost_thumbnail() { - return this.post_thumbnail; - } - - /** - * @return the post_title - */ - public final String getPost_title() { - return this.post_title; - } - - /** - * @return the post_type - */ - public final String getPost_type() { - return this.post_type; - } - - /** - * @return the terms - */ - public final List getTerms() { - return this.terms; - } - - /** - * @return the sticky - */ - public final Boolean isSticky() { - return this.sticky; - } - - /** - * @param comment_status the comment_status to set - */ - public final void setComment_status(final String comment_status) { - this.comment_status = comment_status; - } - - /** - * @param customFields the customFields to set - */ - public final void setCustom_fields(final List customFields) { - this.custom_fields = customFields; - } - - /** - * @param enclosure the enclosure to set - */ - public final void setEnclosure(final Enclosure enclosure) { - this.enclosure = enclosure; - } - - /** - * @param guid the guid to set - */ - public final void setGuid(final String guid) { - this.guid = guid; - } - - /** - * @param link the link to set - */ - public final void setLink(final String link) { - this.link = link; - } - - /** - * @param menu_order the menu_order to set - */ - public final void setMenu_order(final Integer menu_order) { - this.menu_order = menu_order; - } - - /** - * @param ping_status the ping_status to set - */ - public final void setPing_status(final String ping_status) { - this.ping_status = ping_status; - } - - /** - * @param post_author the post_author to set - */ - public final void setPost_author(final Integer post_author) { - this.post_author = post_author; - } - - /** - * @param post_content the post_content to set - */ - public final void setPost_content(final String post_content) { - this.post_content = post_content; - } - - /** - * @param post_date the post_date to set - */ - public final void setPost_date(final Date post_date) { - this.post_date = post_date; - } - - /** - * @param post_date_gmt the post_date_gmt to set - */ - public final void setPost_date_gmt(final Date post_date_gmt) { - this.post_date_gmt = post_date_gmt; - } - - /** - * @param post_excerpt the post_excerpt to set - */ - public final void setPost_excerpt(final String post_excerpt) { - this.post_excerpt = post_excerpt; - } - - /** - * @param post_format the post_format to set - */ - public final void setPost_format(final String post_format) { - this.post_format = post_format; - } - - /** - * @param post_id the post_id to set - */ - public final void setPost_id(final Integer post_id) { - this.post_id = post_id; - } - - /** - * @param post_mime_type the post_mime_type to set - */ - public final void setPost_mime_type(final String post_mime_type) { - this.post_mime_type = post_mime_type; - } - - /** - * @param post_modified the post_modified to set - */ - public final void setPost_modified(final Date post_modified) { - this.post_modified = post_modified; - } - - /** - * @param post_modified_gmt the post_modified_gmt to set - */ - public final void setPost_modified_gmt(final Date post_modified_gmt) { - this.post_modified_gmt = post_modified_gmt; - } - - /** - * @param post_name the post_name to set - */ - public final void setPost_name(final String post_name) { - this.post_name = post_name; - } - - /** - * @param post_parent the post_parent to set - */ - public final void setPost_parent(final Integer post_parent) { - this.post_parent = post_parent; - } - - /** - * @param post_password the post_password to set - */ - public final void setPost_password(final String post_password) { - this.post_password = post_password; - } - - /** - * @param post_status the post_status to set - */ - public final void setPost_status(final String post_status) { - this.post_status = post_status; - } - - /** - * @param post_thumbnail the post_thumbnail to set - */ - public final void setPost_thumbnail(final MediaItem post_thumbnail) { - this.post_thumbnail = post_thumbnail; - } - - /** - * @param post_title the post_title to set - */ - public final void setPost_title(final String post_title) { - this.post_title = post_title; - } - - /** - * @param post_type the post_type to set - */ - public final void setPost_type(final String post_type) { - this.post_type = post_type; - } - - /** - * @param sticky the sticky to set - */ - public final void setSticky(final Boolean sticky) { - this.sticky = sticky; - } - - /** - * @param terms the terms to set + * @return the sticky status */ - public final void setTerms(final List terms) { - this.terms = terms; + public Boolean isSticky() { + return this.getSticky(); } } diff --git a/src/net/bican/wordpress/PostThumbnailImageMeta.java b/src/net/bican/wordpress/PostThumbnailImageMeta.java index 86d3bce..bcafb39 100644 --- a/src/net/bican/wordpress/PostThumbnailImageMeta.java +++ b/src/net/bican/wordpress/PostThumbnailImageMeta.java @@ -1,15 +1,19 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; + /** * Class for keeping image meta data * * @author Can Bican */ +@Getter +@Setter public class PostThumbnailImageMeta extends XmlRpcMapped { Double aperture; // TODO wordpress codex tells it's integer but should be String camera; @@ -25,169 +29,4 @@ public class PostThumbnailImageMeta extends XmlRpcMapped { Double shutter_speed;// TODO wordpress codex tells it's integer but exif // accepts doubles String title; - - /** - * @return the aperture - */ - public final Double getAperture() { - return this.aperture; - } - - /** - * @return the camera - */ - public final String getCamera() { - return this.camera; - } - - /** - * @return the caption - */ - public final String getCaption() { - return this.caption; - } - - /** - * @return the copyright - */ - public final String getCopyright() { - return this.copyright; - } - - /** - * @return the created_timestamp - */ - public final Integer getCreated_timestamp() { - return this.created_timestamp; - } - - /** - * @return the credit - */ - public final String getCredit() { - return this.credit; - } - - /** - * @return the focal_length - */ - public final Double getFocal_length() { - return this.focal_length; - } - - /** - * @return the iso - */ - public final String getIso() { - return this.iso; - } - - /** - * @return the orientation - */ - public final Integer getOrientation() { - return this.orientation; - } - - /** - * @return the shutter_speed - */ - public final Double getShutter_speed() { - return this.shutter_speed; - } - - /** - * @return the title - */ - public final String getTitle() { - return this.title; - } - - /** - * @param aperture - * the aperture to set - */ - public final void setAperture(final Double aperture) { - this.aperture = aperture; - } - - /** - * @param camera - * the camera to set - */ - public final void setCamera(final String camera) { - this.camera = camera; - } - - /** - * @param caption - * the caption to set - */ - public final void setCaption(final String caption) { - this.caption = caption; - } - - /** - * @param copyright - * the copyright to set - */ - public final void setCopyright(final String copyright) { - this.copyright = copyright; - } - - /** - * @param created_timestamp - * the created_timestamp to set - */ - public final void setCreated_timestamp(final Integer created_timestamp) { - this.created_timestamp = created_timestamp; - } - - /** - * @param credit - * the credit to set - */ - public final void setCredit(final String credit) { - this.credit = credit; - } - - /** - * @param focal_length - * the focal_length to set - */ - public final void setFocal_length(final Double focal_length) { - this.focal_length = focal_length; - } - - /** - * @param iso - * the iso to set - */ - public final void setIso(final String iso) { - this.iso = iso; - } - - /** - * @param orientation - * the orientation to set - */ - public final void setOrientation(final Integer orientation) { - this.orientation = orientation; - } - - /** - * @param shutter_speed - * the shutter_speed to set - */ - public final void setShutter_speed(final Double shutter_speed) { - this.shutter_speed = shutter_speed; - } - - /** - * @param title - * the title to set - */ - public final void setTitle(final String title) { - this.title = title; - } } diff --git a/src/net/bican/wordpress/PostType.java b/src/net/bican/wordpress/PostType.java index 31b1134..38323d1 100644 --- a/src/net/bican/wordpress/PostType.java +++ b/src/net/bican/wordpress/PostType.java @@ -1,17 +1,21 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; import java.util.List; +import lombok.Getter; +import lombok.Setter; + /** * Post types for posts * * @author Can Bican */ +@Getter +@Setter public class PostType extends XmlRpcMapped { boolean _builtin; boolean _public; @@ -28,229 +32,4 @@ public class PostType extends XmlRpcMapped { boolean show_ui; Support supports; List taxonomies; - - /** - * @return the cap - */ - public final PostTypeCap getCap() { - return this.cap; - } - - /** - * @return the label - */ - public final String getLabel() { - return this.label; - } - - /** - * @return the labels - */ - public final Labels getLabels() { - return this.labels; - } - - /** - * @return the menu_icon - */ - public final String getMenu_icon() { - return this.menu_icon; - } - - /** - * @return the menu_position - */ - public final int getMenu_position() { - return this.menu_position; - } - - /** - * @return the name - */ - public final String getName() { - return this.name; - } - - /** - * @return the supports - */ - public final Support getSupports() { - return this.supports; - } - - /** - * @return the taxonomies - */ - public final List getTaxonomies() { - return this.taxonomies; - } - - /** - * @return the _builtin - */ - public final boolean is_builtin() { - return this._builtin; - } - - /** - * @return the has_archive - */ - public final boolean isHas_archive() { - return this.has_archive; - } - - /** - * @return the hierarchical - */ - public final boolean isHierarchical() { - return this.hierarchical; - } - - /** - * @return the map_meta_cap - */ - public final boolean isMap_meta_cap() { - return this.map_meta_cap; - } - - /** - * @return the _public - */ - public final boolean isPublic() { - return this._public; - } - - /** - * @return the show_in_menu - */ - public final boolean isShow_in_menu() { - return this.show_in_menu; - } - - /** - * @return the show_ui - */ - public final boolean isShow_ui() { - return this.show_ui; - } - - /** - * @param _builtin - * the _builtin to set - */ - public final void set_builtin(final boolean _builtin) { - this._builtin = _builtin; - } - - /** - * @param cap - * the cap to set - */ - public final void setCap(final PostTypeCap cap) { - this.cap = cap; - } - - /** - * @param has_archive - * the has_archive to set - */ - public final void setHas_archive(final boolean has_archive) { - this.has_archive = has_archive; - } - - /** - * @param hierarchical - * the hierarchical to set - */ - public final void setHierarchical(final boolean hierarchical) { - this.hierarchical = hierarchical; - } - - /** - * @param label - * the label to set - */ - public final void setLabel(final String label) { - this.label = label; - } - - /** - * @param labels - * the labels to set - */ - public final void setLabels(final Labels labels) { - this.labels = labels; - } - - /** - * @param map_meta_cap - * the map_meta_cap to set - */ - public final void setMap_meta_cap(final boolean map_meta_cap) { - this.map_meta_cap = map_meta_cap; - } - - /** - * @param menu_icon - * the menu_icon to set - */ - public final void setMenu_icon(final String menu_icon) { - this.menu_icon = menu_icon; - } - - /** - * @param menu_position - * the menu_position to set - */ - public final void setMenu_position(final int menu_position) { - this.menu_position = menu_position; - } - - /** - * @param name - * the name to set - */ - public final void setName(final String name) { - this.name = name; - } - - /** - * @param _public - * the _public to set - */ - public final void setPublic(final boolean _public) { - this._public = _public; - } - - /** - * @param show_in_menu - * the show_in_menu to set - */ - public final void setShow_in_menu(final boolean show_in_menu) { - this.show_in_menu = show_in_menu; - } - - /** - * @param show_ui - * the show_ui to set - */ - public final void setShow_ui(final boolean show_ui) { - this.show_ui = show_ui; - } - - /** - * @param supports - * the supports to set - */ - public final void setSupports(final Support supports) { - this.supports = supports; - } - - /** - * @param taxonomies - * the taxonomies to set - */ - public final void setTaxonomies(final List taxonomies) { - this.taxonomies = taxonomies; - } } diff --git a/src/net/bican/wordpress/PostTypeCap.java b/src/net/bican/wordpress/PostTypeCap.java index ef2b12c..2b4ac48 100644 --- a/src/net/bican/wordpress/PostTypeCap.java +++ b/src/net/bican/wordpress/PostTypeCap.java @@ -1,15 +1,19 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; + /** * Capabilities for a post type * * @author Can Bican */ +@Getter +@Setter public class PostTypeCap extends XmlRpcMapped { String create_posts; String delete_others_posts; @@ -26,230 +30,4 @@ public class PostTypeCap extends XmlRpcMapped { String read; String read_post; String read_private_posts; - - /** - * @return the create_posts - */ - public final String getCreate_posts() { - return this.create_posts; - } - - /** - * @return the delete_others_posts - */ - public final String getDelete_others_posts() { - return this.delete_others_posts; - } - - /** - * @return the delete_post - */ - public final String getDelete_post() { - return this.delete_post; - } - - /** - * @return the delete_posts - */ - public final String getDelete_posts() { - return this.delete_posts; - } - - /** - * @return the delete_private_posts - */ - public final String getDelete_private_posts() { - return this.delete_private_posts; - } - - /** - * @return the delete_published_posts - */ - public final String getDelete_published_posts() { - return this.delete_published_posts; - } - - /** - * @return the edit_others_posts - */ - public final String getEdit_others_posts() { - return this.edit_others_posts; - } - - /** - * @return the edit_post - */ - public final String getEdit_post() { - return this.edit_post; - } - - /** - * @return the edit_posts - */ - public final String getEdit_posts() { - return this.edit_posts; - } - - /** - * @return the edit_private_posts - */ - public final String getEdit_private_posts() { - return this.edit_private_posts; - } - - /** - * @return the edit_published_posts - */ - public final String getEdit_published_posts() { - return this.edit_published_posts; - } - - /** - * @return the publish_posts - */ - public final String getPublish_posts() { - return this.publish_posts; - } - - /** - * @return the read - */ - public final String getRead() { - return this.read; - } - - /** - * @return the read_post - */ - public final String getRead_post() { - return this.read_post; - } - - /** - * @return the read_private_posts - */ - public final String getRead_private_posts() { - return this.read_private_posts; - } - - /** - * @param create_posts - * the create_posts to set - */ - public final void setCreate_posts(final String create_posts) { - this.create_posts = create_posts; - } - - /** - * @param delete_others_posts - * the delete_others_posts to set - */ - public final void setDelete_others_posts(final String delete_others_posts) { - this.delete_others_posts = delete_others_posts; - } - - /** - * @param delete_post - * the delete_post to set - */ - public final void setDelete_post(final String delete_post) { - this.delete_post = delete_post; - } - - /** - * @param delete_posts - * the delete_posts to set - */ - public final void setDelete_posts(final String delete_posts) { - this.delete_posts = delete_posts; - } - - /** - * @param delete_private_posts - * the delete_private_posts to set - */ - public final void setDelete_private_posts(final String delete_private_posts) { - this.delete_private_posts = delete_private_posts; - } - - /** - * @param delete_published_posts - * the delete_published_posts to set - */ - public final void setDelete_published_posts( - final String delete_published_posts) { - this.delete_published_posts = delete_published_posts; - } - - /** - * @param edit_others_posts - * the edit_others_posts to set - */ - public final void setEdit_others_posts(final String edit_others_posts) { - this.edit_others_posts = edit_others_posts; - } - - /** - * @param edit_post - * the edit_post to set - */ - public final void setEdit_post(final String edit_post) { - this.edit_post = edit_post; - } - - /** - * @param edit_posts - * the edit_posts to set - */ - public final void setEdit_posts(final String edit_posts) { - this.edit_posts = edit_posts; - } - - /** - * @param edit_private_posts - * the edit_private_posts to set - */ - public final void setEdit_private_posts(final String edit_private_posts) { - this.edit_private_posts = edit_private_posts; - } - - /** - * @param edit_published_posts - * the edit_published_posts to set - */ - public final void setEdit_published_posts(final String edit_published_posts) { - this.edit_published_posts = edit_published_posts; - } - - /** - * @param publish_posts - * the publish_posts to set - */ - public final void setPublish_posts(final String publish_posts) { - this.publish_posts = publish_posts; - } - - /** - * @param read - * the read to set - */ - public final void setRead(final String read) { - this.read = read; - } - - /** - * @param read_post - * the read_post to set - */ - public final void setRead_post(final String read_post) { - this.read_post = read_post; - } - - /** - * @param read_private_posts - * the read_private_posts to set - */ - public final void setRead_private_posts(final String read_private_posts) { - this.read_private_posts = read_private_posts; - } } diff --git a/src/net/bican/wordpress/Support.java b/src/net/bican/wordpress/Support.java index 6fc37ab..e905890 100644 --- a/src/net/bican/wordpress/Support.java +++ b/src/net/bican/wordpress/Support.java @@ -1,10 +1,11 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; import redstone.xmlrpc.XmlRpcStruct; /** @@ -12,6 +13,8 @@ * * @author Can Bican */ +@Getter +@Setter public class Support extends XmlRpcMapped { private static final String CUSTOM_FIELDS_FIELD = "custom-fields"; //$NON-NLS-1$ private static final String POST_FORMATS_FIELD = "post-formats"; //$NON-NLS-1$ @@ -25,7 +28,7 @@ public class Support extends XmlRpcMapped { Boolean thumbnail; Boolean title; Boolean trackbacks; - + @Override public void fromXmlRpcStruct(final XmlRpcStruct x) { super.fromXmlRpcStruct(x); @@ -38,157 +41,7 @@ public void fromXmlRpcStruct(final XmlRpcStruct x) { this.setCustomFields(pf2); } } - - /** - * @return the author - */ - public final Boolean isAuthor() { - return this.author; - } - - /** - * @return the comments - */ - public final Boolean isComments() { - return this.comments; - } - - /** - * @return the customFields - */ - public final Boolean isCustomFields() { - return this.customFields; - } - - /** - * @return the editor - */ - public final Boolean isEditor() { - return this.editor; - } - - /** - * @return the excerpt - */ - public final Boolean isExcerpt() { - return this.excerpt; - } - - /** - * @return the postFormats - */ - public final Boolean isPostFormats() { - return this.postFormats; - } - - /** - * @return the revisions - */ - public final Boolean isRevisions() { - return this.revisions; - } - - /** - * @return the thumbnail - */ - public final Boolean isThumbnail() { - return this.thumbnail; - } - - /** - * @return the title - */ - public final Boolean isTitle() { - return this.title; - } - - /** - * @return the trackbacks - */ - public final Boolean isTrackbacks() { - return this.trackbacks; - } - - /** - * @param author - * the author to set - */ - public final void setAuthor(final Boolean author) { - this.author = author; - } - - /** - * @param comments - * the comments to set - */ - public final void setComments(final Boolean comments) { - this.comments = comments; - } - - /** - * @param customFields - * the customFields to set - */ - public final void setCustomFields(final Boolean customFields) { - this.customFields = customFields; - } - - /** - * @param editor - * the editor to set - */ - public final void setEditor(final Boolean editor) { - this.editor = editor; - } - - /** - * @param excerpt - * the excerpt to set - */ - public final void setExcerpt(final Boolean excerpt) { - this.excerpt = excerpt; - } - - /** - * @param postFormats - * the postFormats to set - */ - public final void setPostFormats(final Boolean postFormats) { - this.postFormats = postFormats; - } - - /** - * @param revisions - * the revisions to set - */ - public final void setRevisions(final Boolean revisions) { - this.revisions = revisions; - } - - /** - * @param thumbnail - * the thumbnail to set - */ - public final void setThumbnail(final Boolean thumbnail) { - this.thumbnail = thumbnail; - } - - /** - * @param title - * the title to set - */ - public final void setTitle(final Boolean title) { - this.title = title; - } - - /** - * @param trackbacks - * the trackbacks to set - */ - public final void setTrackbacks(final Boolean trackbacks) { - this.trackbacks = trackbacks; - } - + @SuppressWarnings("unchecked") @Override public XmlRpcStruct toXmlRpcStruct() { @@ -201,4 +54,18 @@ public XmlRpcStruct toXmlRpcStruct() { } return result; } + + /** + * @return if it's custom fields + */ + public Boolean isCustomFields() { + return this.getCustomFields(); + } + + /** + * @return if it's post formats + */ + public Boolean isPostFormats() { + return this.getPostFormats(); + } } diff --git a/src/net/bican/wordpress/Taxonomy.java b/src/net/bican/wordpress/Taxonomy.java index 8ddcbb4..4ce43b7 100644 --- a/src/net/bican/wordpress/Taxonomy.java +++ b/src/net/bican/wordpress/Taxonomy.java @@ -1,12 +1,13 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; import java.util.List; +import lombok.Getter; +import lombok.Setter; import net.bican.wordpress.util.StringHeader; /** @@ -14,6 +15,8 @@ * * @author Can Bican */ +@Getter +@Setter public class Taxonomy extends XmlRpcMapped implements StringHeader { boolean _builtin; Cap cap; @@ -24,144 +27,9 @@ public class Taxonomy extends XmlRpcMapped implements StringHeader { List object_type; boolean p; boolean show_ui; - - /** - * @return the cap - */ - public Cap getCap() { - return this.cap; - } - - /** - * @return the label - */ - public String getLabel() { - return this.label; - } - - /** - * @return the labels - */ - public Labels getLabels() { - return this.labels; - } - - /** - * @return the name - */ - public String getName() { - return this.name; - } - - /** - * @return the object type list - */ - public List getObject_type() { - return this.object_type; - } - + @Override public String getStringHeader() { return ""; // this is not a tabulated list //$NON-NLS-1$ } - - /** - * @return the built-in status - */ - public boolean is_builtin() { - return this._builtin; - } - - /** - * @return the hierarchical status - */ - public boolean isHierarchical() { - return this.hierarchical; - } - - /** - * @return the public status - */ - public boolean isPublic() { - return this.p; - } - - /** - * @return the show-ui status - */ - public boolean isShow_ui() { - return this.show_ui; - } - - /** - * @param _builtin - * built-in status - */ - public void set_builtin(final boolean _builtin) { - this._builtin = _builtin; - } - - /** - * @param cap - * cap to set - */ - public void setCap(final Cap cap) { - this.cap = cap; - } - - /** - * @param hierarchical - * hierarchical status - */ - public void setHierarchical(final boolean hierarchical) { - this.hierarchical = hierarchical; - } - - /** - * @param label - * label to set - */ - public void setLabel(final String label) { - this.label = label; - } - - /** - * @param labels - * labels to set - */ - public void setLabels(final Labels labels) { - this.labels = labels; - } - - /** - * @param name - * name to set - */ - public void setName(final String name) { - this.name = name; - } - - /** - * @param object_type - * object type list to set - */ - public void setObject_type(final List object_type) { - this.object_type = object_type; - } - - /** - * @param p - * public status - */ - public void setPublic(final boolean p) { - this.p = p; - } - - /** - * @param show_ui - * show-ui status - */ - public void setShow_ui(final boolean show_ui) { - this.show_ui = show_ui; - } } diff --git a/src/net/bican/wordpress/TermFilter.java b/src/net/bican/wordpress/TermFilter.java index abaa8bc..3856433 100644 --- a/src/net/bican/wordpress/TermFilter.java +++ b/src/net/bican/wordpress/TermFilter.java @@ -1,15 +1,19 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; + /** * Object for filtering terms during search * * @author Can Bican */ +@Getter +@Setter public class TermFilter extends XmlRpcMapped { boolean hide_empty; Integer number; @@ -17,94 +21,4 @@ public class TermFilter extends XmlRpcMapped { String order; String orderby; String search; - - /** - * @return the number - */ - public Integer getNumber() { - return this.number; - } - - /** - * @return the offset - */ - public Integer getOffset() { - return this.offset; - } - - /** - * @return the order - */ - public String getOrder() { - return this.order; - } - - /** - * @return the order-by - */ - public String getOrderby() { - return this.orderby; - } - - /** - * @return the search terms - */ - public String getSearch() { - return this.search; - } - - /** - * @return the hide-empty status - */ - public boolean isHide_empty() { - return this.hide_empty; - } - - /** - * @param hide_empty - * hide-empty status to set - */ - public void setHide_empty(final boolean hide_empty) { - this.hide_empty = hide_empty; - } - - /** - * @param number - * number to set - */ - public void setNumber(final Integer number) { - this.number = number; - } - - /** - * @param offset - * offset to set - */ - public void setOffset(final Integer offset) { - this.offset = offset; - } - - /** - * @param order - * order to set - */ - public void setOrder(final String order) { - this.order = order; - } - - /** - * @param orderby - * order-by to set - */ - public void setOrderby(final String orderby) { - this.orderby = orderby; - } - - /** - * @param search - * search terms to set - */ - public void setSearch(final String search) { - this.search = search; - } } diff --git a/src/net/bican/wordpress/User.java b/src/net/bican/wordpress/User.java index 750447c..f8944b3 100644 --- a/src/net/bican/wordpress/User.java +++ b/src/net/bican/wordpress/User.java @@ -1,13 +1,14 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; import java.util.Date; import java.util.List; +import lombok.Getter; +import lombok.Setter; import net.bican.wordpress.util.StringHeader; /** @@ -15,6 +16,8 @@ * * @author Can Bican */ +@Getter +@Setter public class User extends XmlRpcMapped implements StringHeader { String bio; String display_name; @@ -28,197 +31,11 @@ public class User extends XmlRpcMapped implements StringHeader { String url; Integer user_id; String username; - - /** - * @return the bio - */ - public final String getBio() { - return this.bio; - } - - /** - * @return the display_name - */ - public final String getDisplay_name() { - return this.display_name; - } - - /** - * @return the email - */ - public final String getEmail() { - return this.email; - } - - /** - * @return the first_name - */ - public final String getFirst_name() { - return this.first_name; - } - - /** - * @return the last_name - */ - public final String getLast_name() { - return this.last_name; - } - - /** - * @return the nicename - */ - public final String getNicename() { - return this.nicename; - } - - /** - * @return the nickname - */ - public final String getNickname() { - return this.nickname; - } - - /** - * @return the registered - */ - public final Date getRegistered() { - return this.registered; - } - - /** - * @return the roles - */ - public final List getRoles() { - return this.roles; - } - - /** - * (non-Javadoc) - * - * @see net.bican.wordpress.util.StringHeader#getStringHeader() - */ + @Override @SuppressWarnings("nls") public String getStringHeader() { final String TAB = ":"; - return "First name" + TAB + "Last name" + TAB + "Nick name" + TAB + "Url" - + TAB + "User ID"; - } - - /** - * @return the url - */ - public final String getUrl() { - return this.url; - } - - /** - * @return the user_id - */ - public final Integer getUser_id() { - return this.user_id; - } - - /** - * @return the username - */ - public final String getUsername() { - return this.username; - } - - /** - * @param bio - * the bio to set - */ - public final void setBio(final String bio) { - this.bio = bio; - } - - /** - * @param display_name - * the display_name to set - */ - public final void setDisplay_name(final String display_name) { - this.display_name = display_name; - } - - /** - * @param email - * the email to set - */ - public final void setEmail(final String email) { - this.email = email; - } - - /** - * @param first_name - * the first_name to set - */ - public final void setFirst_name(final String first_name) { - this.first_name = first_name; - } - - /** - * @param last_name - * the last_name to set - */ - public final void setLast_name(final String last_name) { - this.last_name = last_name; - } - - /** - * @param nicename - * the nicename to set - */ - public final void setNicename(final String nicename) { - this.nicename = nicename; - } - - /** - * @param nickname - * the nickname to set - */ - public final void setNickname(final String nickname) { - this.nickname = nickname; - } - - /** - * @param registered - * the registered to set - */ - public final void setRegistered(final Date registered) { - this.registered = registered; - } - - /** - * @param roles - * the roles to set - */ - public final void setRoles(final List roles) { - this.roles = roles; - } - - /** - * @param url - * the url to set - */ - public final void setUrl(final String url) { - this.url = url; - } - - /** - * @param user_id - * the user_id to set - */ - public final void setUser_id(final Integer user_id) { - this.user_id = user_id; - } - - /** - * @param username - * the username to set - */ - public final void setUsername(final String username) { - this.username = username; + return "First name" + TAB + "Last name" + TAB + "Nick name" + TAB + "Url" + TAB + "User ID"; } } diff --git a/src/net/bican/wordpress/UserBlog.java b/src/net/bican/wordpress/UserBlog.java index 3d0cd57..1dff6ad 100644 --- a/src/net/bican/wordpress/UserBlog.java +++ b/src/net/bican/wordpress/UserBlog.java @@ -1,95 +1,23 @@ /* - * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright - * 2012-2015 Can Bican See the file 'COPYING' in the - * distribution for licensing terms. + * Wordpress-java https://github.com/canbican/wordpress-java/ Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. */ package net.bican.wordpress; +import lombok.Getter; +import lombok.Setter; + /** * The class for keeping user blog entries * * @author Can Bican */ +@Getter +@Setter public class UserBlog extends XmlRpcMapped { Integer blogid; String blogName; boolean isAdmin; String url; String xmlrpc; - - /** - * @return the blog id - */ - public Integer getBlogid() { - return this.blogid; - } - - /** - * @return the blog name - */ - public String getBlogName() { - return this.blogName; - } - - /** - * @return the url - */ - public String getUrl() { - return this.url; - } - - /** - * @return the xml rpc url - */ - public String getXmlrpc() { - return this.xmlrpc; - } - - /** - * @return the admin status - */ - public boolean isAdmin() { - return this.isAdmin; - } - - /** - * @param isAdmin - * admin status to set - */ - public void setAdmin(final boolean isAdmin) { - this.isAdmin = isAdmin; - } - - /** - * @param blogid - * blog id to set - */ - public void setBlogid(final Integer blogid) { - this.blogid = blogid; - } - - /** - * @param blogName - * blog name to set - */ - public void setBlogName(final String blogName) { - this.blogName = blogName; - } - - /** - * @param url - * url to set - */ - public void setUrl(final String url) { - this.url = url; - } - - /** - * @param xmlrpc - * xml rpc url to set - */ - public void setXmlrpc(final String xmlrpc) { - this.xmlrpc = xmlrpc; - } - } diff --git a/src/net/bican/wordpress/Wordpress.java b/src/net/bican/wordpress/Wordpress.java index 47cdbad..fd77516 100644 --- a/src/net/bican/wordpress/Wordpress.java +++ b/src/net/bican/wordpress/Wordpress.java @@ -43,7 +43,7 @@ public class Wordpress { @SuppressWarnings("unchecked") private static List fillFromXmlRpcArray(final XmlRpcArray r, - final Class cl, final T item) { + final Class cl, @SuppressWarnings("unused") final T item) { List result = null; try { result = new ArrayList<>(); @@ -87,6 +87,7 @@ private static List