Package com.marcpg.libpg.web.discord
Record Class Embed.Author
java.lang.Object
java.lang.Record
com.marcpg.libpg.web.discord.Embed.Author
- Record Components:
name
- The author's name in plaintext.iconUrl
- The author's little icon or profile picture.url
- The author URL.
- Enclosing class:
- Embed
Represents the author information of an embed.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull String
build()
Formats the author into a compact representation in JSON, which is required for sending it to the Discord API.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.iconUrl()
Returns the value of theiconUrl
record component.boolean
isEmpty()
Checks if the author is empty.name()
Returns the value of thename
record component.final String
toString()
Returns a string representation of this record class.url()
Returns the value of theurl
record component.
-
Constructor Details
-
Method Details
-
isEmpty
public boolean isEmpty()Checks if the author is empty. This doesn't only include if the values arenull
, but also if they are empty/blank.- Returns:
true
if the author is empty,false
otherwise.
-
build
Formats the author into a compact representation in JSON, which is required for sending it to the Discord API.- Returns:
- The formatted JSON representation.
-
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)
. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
iconUrl
Returns the value of theiconUrl
record component.- Returns:
- the value of the
iconUrl
record component
-
url
Returns the value of theurl
record component.- Returns:
- the value of the
url
record component
-