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.- 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.- 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 Summary
ConstructorsConstructorDescriptionWPPost(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) Creates an instance of aWPPostrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongauthor()Returns the value of theauthorrecord component.Returns the value of thecategoriesrecord component.@Nullable StringReturns the value of thecommentStatusrecord component.@NotNull WPRenderedcontent()Returns the value of thecontentrecord component.@Nullable LocalDateTimedate()Returns the value of thedaterecord component.@Nullable LocalDateTimedateGmt()Returns the value of thedateGmtrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable WPRenderedexcerpt()Returns the value of theexcerptrecord component.longReturns the value of thefeaturedMediarecord component.@Nullable Stringformat()Returns the value of theformatrecord component.@Nullable WPRenderedguid()Returns the value of theguidrecord component.final inthashCode()Returns a hash code value for this object.longid()Returns the value of theidrecord component.@NotNull Stringlink()Returns the value of thelinkrecord component.meta()Returns the value of themetarecord component.@Nullable LocalDateTimemodified()Returns the value of themodifiedrecord component.@Nullable LocalDateTimeReturns the value of themodifiedGmtrecord component.@Nullable StringReturns the value of thepingStatusrecord component.@NotNull Stringslug()Returns the value of theslugrecord component.@NotNull Stringstatus()Returns the value of thestatusrecord component.booleansticky()Returns the value of thestickyrecord component.tags()Returns the value of thetagsrecord component.@Nullable Stringtemplate()Returns the value of thetemplaterecord component.@NotNull WPRenderedtitle()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.@NotNull Stringtype()Returns the value of thetyperecord component.
-
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 aWPPostrecord class.- Parameters:
id- the value for theidrecord componentdate- the value for thedaterecord componentdateGmt- the value for thedateGmtrecord componentguid- the value for theguidrecord componentmodified- the value for themodifiedrecord componentmodifiedGmt- the value for themodifiedGmtrecord componentslug- the value for theslugrecord componentstatus- the value for thestatusrecord componenttype- the value for thetyperecord componentlink- the value for thelinkrecord componenttitle- the value for thetitlerecord componentcontent- the value for thecontentrecord componentexcerpt- the value for theexcerptrecord componentauthor- the value for theauthorrecord componentfeaturedMedia- the value for thefeaturedMediarecord componentcommentStatus- the value for thecommentStatusrecord componentpingStatus- the value for thepingStatusrecord componentsticky- the value for thestickyrecord componenttemplate- the value for thetemplaterecord componentformat- the value for theformatrecord componentmeta- the value for themetarecord componentcategories- the value for thecategoriesrecord componenttags- the value for thetagsrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
public long id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
date
Returns the value of thedaterecord component.- Returns:
- the value of the
daterecord component
-
dateGmt
Returns the value of thedateGmtrecord component.- Returns:
- the value of the
dateGmtrecord component
-
guid
Returns the value of theguidrecord component.- Returns:
- the value of the
guidrecord component
-
modified
Returns the value of themodifiedrecord component.- Returns:
- the value of the
modifiedrecord component
-
modifiedGmt
Returns the value of themodifiedGmtrecord component.- Returns:
- the value of the
modifiedGmtrecord component
-
slug
Returns the value of theslugrecord component.- Returns:
- the value of the
slugrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
link
Returns the value of thelinkrecord component.- Returns:
- the value of the
linkrecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
excerpt
Returns the value of theexcerptrecord component.- Returns:
- the value of the
excerptrecord component
-
author
public long author()Returns the value of theauthorrecord component.- Returns:
- the value of the
authorrecord component
-
featuredMedia
public long featuredMedia()Returns the value of thefeaturedMediarecord component.- Returns:
- the value of the
featuredMediarecord component
-
commentStatus
Returns the value of thecommentStatusrecord component.- Returns:
- the value of the
commentStatusrecord component
-
pingStatus
Returns the value of thepingStatusrecord component.- Returns:
- the value of the
pingStatusrecord component
-
sticky
public boolean sticky()Returns the value of thestickyrecord component.- Returns:
- the value of the
stickyrecord component
-
template
Returns the value of thetemplaterecord component.- Returns:
- the value of the
templaterecord component
-
format
Returns the value of theformatrecord component.- Returns:
- the value of the
formatrecord component
-
meta
Returns the value of themetarecord component.- Returns:
- the value of the
metarecord component
-
categories
Returns the value of thecategoriesrecord component.- Returns:
- the value of the
categoriesrecord component
-
tags
Returns the value of thetagsrecord component.- Returns:
- the value of the
tagsrecord component
-