Package net.ygbstudio.powerwp4j.builders
Class WPBasicPayloadBuilder
java.lang.Object
net.ygbstudio.powerwp4j.base.extension.builders.AbstractPayloadBuilder<WPBasicPayloadBuilder>
net.ygbstudio.powerwp4j.builders.WPBasicPayloadBuilder
Basic payload builder for WordPress REST Payloads. It can be used for posts and taxonomy
creation.
Inherits all methods from AbstractPayloadBuilder to provide a chainable pattern for
building payloads for the WordPress REST API. The payload is built using a JsonNode
object.
In case you need to attach a payload to a media file, use WPMediaPayloadBuilder.
- See Also:
-
Field Summary
Fields inherited from class net.ygbstudio.powerwp4j.base.extension.builders.AbstractPayloadBuilder
author, categories, commentStatus, content, description, excerpt, featuredMedia, format, name, password, slug, status, sticky, tags, title, type -
Method Summary
Modifier and TypeMethodDescriptiontools.jackson.databind.JsonNodebuild()Builds the payload as a JsonNode.static @NotNull WPBasicPayloadBuilderbuilder()Creates a new instance ofWPBasicPayloadBuilder.Returns the configured author ID, ornullif unset.Returns the configured category IDs, ornullif unset.Returns the configured comment status, ornullif unset.Returns the configured content, ornullif unset.Returns the configured taxonomy description, ornullif unset.Returns the configured excerpt, ornullif unset.Returns the configured featured media ID, ornullif unset.getName()Returns the configured taxonomy name, ornullif unset.getSlug()Returns the configured slug, ornullif unset.Returns the configured post status, ornullif unset.getTags()Returns the configured tag IDs, ornullif unset.getTitle()Returns the configured title, ornullif unset.protected WPBasicPayloadBuilderself()Returns the current instance of the payload builder.Methods inherited from class net.ygbstudio.powerwp4j.base.extension.builders.AbstractPayloadBuilder
author, categories, clear, commentStatus, content, description, excerpt, featuredMedia, format, name, password, slug, status, sticky, tags, title, type
-
Method Details
-
self
Description copied from class:AbstractPayloadBuilderReturns the current instance of the payload builder. This is a protected method used for chaining method calls.The cast to type T is safe because the method is only called within the class hierarchy and this class is parameterized with the type of the subclass.
- Overrides:
selfin classAbstractPayloadBuilder<WPBasicPayloadBuilder>- Returns:
- the current instance of the payload builder
-
builder
Creates a new instance ofWPBasicPayloadBuilder.- Returns:
- A new instance of
WPBasicPayloadBuilder.
-
getStatus
Returns the configured post status, ornullif unset. -
getCategories
Returns the configured category IDs, ornullif unset. -
getTags
Returns the configured tag IDs, ornullif unset. -
getSlug
Returns the configured slug, ornullif unset. -
getTitle
Returns the configured title, ornullif unset. -
getContent
Returns the configured content, ornullif unset. -
getExcerpt
Returns the configured excerpt, ornullif unset. -
getAuthor
Returns the configured author ID, ornullif unset. -
getFeaturedMedia
Returns the configured featured media ID, ornullif unset. -
getName
Returns the configured taxonomy name, ornullif unset. -
getDescription
Returns the configured taxonomy description, ornullif unset. -
getCommentStatus
Returns the configured comment status, ornullif unset. -
build
public tools.jackson.databind.JsonNode build()Description copied from class:AbstractPayloadBuilderBuilds the payload as a JsonNode.- Specified by:
buildin classAbstractPayloadBuilder<WPBasicPayloadBuilder>- Returns:
- the built payload as a JsonNode
-