Record Class WPPost

java.lang.Object
java.lang.Record
net.ygbstudio.powerwp4j.models.entities.WPPost
Record Components:
id - The unique identifier of the post.
date - The date the post was published, in the site's timezone.
dateGmt - The date the post was published, as GMT.
guid - The globally unique identifier for the post.
modified - The date the post was last modified, in the site's timezone.
modifiedGmt - The date the post was last modified, as GMT.
slug - An alphanumeric identifier for the post unique to its type.
status - A named status for the post.
type - The type of the post.
link - The URL to the post.
title - The title for the post.
content - The content for the post.
excerpt - The excerpt for the post.
author - The ID for the author of the post.
featuredMedia - The ID of the featured media for the post.
commentStatus - Whether or not comments are open on the post.
pingStatus - Whether or not the post can be pinged.
sticky - Whether or not the post should be treated as sticky.
template - The theme file to use to display the post.
format - The format of the post.
meta - Meta fields.
categories - The terms assigned to the post in the category taxonomy.
tags - The terms assigned to the post in the post_tag taxonomy.

public record WPPost(long id, @Nullable LocalDateTime date, @Nullable LocalDateTime dateGmt, @Nullable WPRendered guid, @Nullable LocalDateTime modified, @Nullable LocalDateTime modifiedGmt, @NotNull String slug, @NotNull String status, @NotNull String type, @NotNull String link, @NotNull WPRendered title, @NotNull WPRendered content, @Nullable WPRendered excerpt, long author, long featuredMedia, @Nullable String commentStatus, @Nullable String pingStatus, boolean sticky, @Nullable String template, @Nullable String format, @Nullable Map<String,Object> meta, @Nullable List<? extends Number> categories, @Nullable List<? extends Number> tags) extends Record
A record representing a WordPress Post.
  • Constructor Details

    • WPPost

      public WPPost(long id, @Nullable @Nullable LocalDateTime date, @Nullable @Nullable LocalDateTime dateGmt, @Nullable @Nullable WPRendered guid, @Nullable @Nullable LocalDateTime modified, @Nullable @Nullable LocalDateTime modifiedGmt, @NotNull @NotNull String slug, @NotNull @NotNull String status, @NotNull @NotNull String type, @NotNull @NotNull String link, @NotNull @NotNull WPRendered title, @NotNull @NotNull WPRendered content, @Nullable @Nullable WPRendered excerpt, long author, long featuredMedia, @Nullable @Nullable String commentStatus, @Nullable @Nullable String pingStatus, boolean sticky, @Nullable @Nullable String template, @Nullable @Nullable String format, @Nullable @Nullable Map<String,Object> meta, @Nullable @Nullable List<? extends Number> categories, @Nullable @Nullable List<? extends Number> tags)
      Creates an instance of a WPPost record class.
      Parameters:
      id - the value for the id record component
      date - the value for the date record component
      dateGmt - the value for the dateGmt record component
      guid - the value for the guid record component
      modified - the value for the modified record component
      modifiedGmt - the value for the modifiedGmt record component
      slug - the value for the slug record component
      status - the value for the status record component
      type - the value for the type record component
      link - the value for the link record component
      title - the value for the title record component
      content - the value for the content record component
      excerpt - the value for the excerpt record component
      author - the value for the author record component
      featuredMedia - the value for the featuredMedia record component
      commentStatus - the value for the commentStatus record component
      pingStatus - the value for the pingStatus record component
      sticky - the value for the sticky record component
      template - the value for the template record component
      format - the value for the format record component
      meta - the value for the meta record component
      categories - the value for the categories record component
      tags - the value for the tags record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public long id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • date

      @Nullable public @Nullable LocalDateTime date()
      Returns the value of the date record component.
      Returns:
      the value of the date record component
    • dateGmt

      @Nullable public @Nullable LocalDateTime dateGmt()
      Returns the value of the dateGmt record component.
      Returns:
      the value of the dateGmt record component
    • guid

      @Nullable public @Nullable WPRendered guid()
      Returns the value of the guid record component.
      Returns:
      the value of the guid record component
    • modified

      @Nullable public @Nullable LocalDateTime modified()
      Returns the value of the modified record component.
      Returns:
      the value of the modified record component
    • modifiedGmt

      @Nullable public @Nullable LocalDateTime modifiedGmt()
      Returns the value of the modifiedGmt record component.
      Returns:
      the value of the modifiedGmt record component
    • slug

      @NotNull public @NotNull String slug()
      Returns the value of the slug record component.
      Returns:
      the value of the slug record component
    • status

      @NotNull public @NotNull String status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • type

      @NotNull public @NotNull String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • link

      @NotNull public @NotNull String link()
      Returns the value of the link record component.
      Returns:
      the value of the link record component
    • title

      @NotNull public @NotNull WPRendered title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • content

      @NotNull public @NotNull WPRendered content()
      Returns the value of the content record component.
      Returns:
      the value of the content record component
    • excerpt

      @Nullable public @Nullable WPRendered excerpt()
      Returns the value of the excerpt record component.
      Returns:
      the value of the excerpt record component
    • author

      public long author()
      Returns the value of the author record component.
      Returns:
      the value of the author record component
    • featuredMedia

      public long featuredMedia()
      Returns the value of the featuredMedia record component.
      Returns:
      the value of the featuredMedia record component
    • commentStatus

      @Nullable public @Nullable String commentStatus()
      Returns the value of the commentStatus record component.
      Returns:
      the value of the commentStatus record component
    • pingStatus

      @Nullable public @Nullable String pingStatus()
      Returns the value of the pingStatus record component.
      Returns:
      the value of the pingStatus record component
    • sticky

      public boolean sticky()
      Returns the value of the sticky record component.
      Returns:
      the value of the sticky record component
    • template

      @Nullable public @Nullable String template()
      Returns the value of the template record component.
      Returns:
      the value of the template record component
    • format

      @Nullable public @Nullable String format()
      Returns the value of the format record component.
      Returns:
      the value of the format record component
    • meta

      @Nullable public @Nullable Map<String,Object> meta()
      Returns the value of the meta record component.
      Returns:
      the value of the meta record component
    • categories

      @Nullable public @Nullable List<? extends Number> categories()
      Returns the value of the categories record component.
      Returns:
      the value of the categories record component
    • tags

      @Nullable public @Nullable List<? extends Number> tags()
      Returns the value of the tags record component.
      Returns:
      the value of the tags record component