Class WPBasicPayloadBuilder


public class WPBasicPayloadBuilder extends AbstractPayloadBuilder<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:
  • Method Details

    • self

      protected WPBasicPayloadBuilder self()
      Description copied from class: AbstractPayloadBuilder
      Returns 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:
      self in class AbstractPayloadBuilder<WPBasicPayloadBuilder>
      Returns:
      the current instance of the payload builder
    • builder

      @Contract(" -> new") @NotNull public static @NotNull WPBasicPayloadBuilder builder()
      Creates a new instance of WPBasicPayloadBuilder.
      Returns:
      A new instance of WPBasicPayloadBuilder.
    • getStatus

      public PostStatusEnum getStatus()
      Returns the configured post status, or null if unset.
    • getCategories

      public List<Integer> getCategories()
      Returns the configured category IDs, or null if unset.
    • getTags

      public List<Integer> getTags()
      Returns the configured tag IDs, or null if unset.
    • getSlug

      public String getSlug()
      Returns the configured slug, or null if unset.
    • getTitle

      public String getTitle()
      Returns the configured title, or null if unset.
    • getContent

      public String getContent()
      Returns the configured content, or null if unset.
    • getExcerpt

      public String getExcerpt()
      Returns the configured excerpt, or null if unset.
    • getAuthor

      public Integer getAuthor()
      Returns the configured author ID, or null if unset.
    • getFeaturedMedia

      public Integer getFeaturedMedia()
      Returns the configured featured media ID, or null if unset.
    • getName

      public String getName()
      Returns the configured taxonomy name, or null if unset.
    • getDescription

      public String getDescription()
      Returns the configured taxonomy description, or null if unset.
    • getCommentStatus

      public CommentStatusEnum getCommentStatus()
      Returns the configured comment status, or null if unset.
    • build

      public tools.jackson.databind.JsonNode build()
      Description copied from class: AbstractPayloadBuilder
      Builds the payload as a JsonNode.
      Specified by:
      build in class AbstractPayloadBuilder<WPBasicPayloadBuilder>
      Returns:
      the built payload as a JsonNode