Package com.mcawful.social
Record Class SocialItem
java.lang.Object
java.lang.Record
com.mcawful.social.SocialItem
- Record Components:
type- the kind of activity:post,repost,mention,replyorquoteid- the platform's id of the item- the permanent id of the account that made it- the account name of its author, such as a handle- the display name of its author; may be emptytext- the text of the item; for a repost, the text of the post that was repostedurl- the web address of the item; for a repost, the post that was repostedcreatedAt- when the item was seen by the platform, as an ISO-8601 instant
public record SocialItem(String type, String id, String authorId, String authorName, String authorDisplayName, String text, String url, String createdAt)
extends Record
One piece of activity on a
SocialPlatform- Author:
- mcawful
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theauthorDisplayNamerecord component.authorId()Returns the value of theauthorIdrecord component.Returns the value of theauthorNamerecord component.Returns the value of thecreatedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.text()Returns the value of thetextrecord component.toJSON()Returns the item as JSON, as stored in thelast_<poll type>settingfinal StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.url()Returns the value of theurlrecord component.
-
Constructor Details
-
SocialItem
public SocialItem(String type, String id, String authorId, String authorName, String authorDisplayName, String text, String url, String createdAt) Creates an instance of aSocialItemrecord class.- Parameters:
type- the value for thetyperecord componentid- the value for theidrecord componentauthorId- the value for theauthorIdrecord componentauthorName- the value for theauthorNamerecord componentauthorDisplayName- the value for theauthorDisplayNamerecord componenttext- the value for thetextrecord componenturl- the value for theurlrecord componentcreatedAt- the value for thecreatedAtrecord component
-
-
Method Details
-
toJSON
Returns the item as JSON, as stored in thelast_<poll type>setting- Returns:
- the JSON text
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
authorId
Returns the value of theauthorIdrecord component.- Returns:
- the value of the
authorIdrecord component
-
authorName
Returns the value of theauthorNamerecord component.- Returns:
- the value of the
authorNamerecord component
-
authorDisplayName
Returns the value of theauthorDisplayNamerecord component.- Returns:
- the value of the
authorDisplayNamerecord component
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
url
Returns the value of theurlrecord component.- Returns:
- the value of the
urlrecord component
-
createdAt
Returns the value of thecreatedAtrecord component.- Returns:
- the value of the
createdAtrecord component
-