Package com.marcpg.libpg.web.discord
Record Class Embed.Field
java.lang.Object
java.lang.Record
com.marcpg.libpg.web.discord.Embed.Field
- Record Components:
name
- The name/title of the field.value
- The plaintext that appears below the name and holds the main information.inline
- If the field should be inline with other fields.
- Enclosing class:
- Embed
Represents a field of an embed.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull String
build()
Formats the field 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.boolean
inline()
Returns the value of theinline
record component.boolean
isEmpty()
Checks if the field's strings are blank.name()
Returns the value of thename
record component.final String
toString()
Returns a string representation of this record class.value()
Returns the value of thevalue
record component.
-
Constructor Details
-
Method Details
-
isEmpty
public boolean isEmpty()Checks if the field's strings are blank.- Returns:
true
if the field is blank,false
otherwise.
-
build
Formats the field 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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
value
Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-
inline
public boolean inline()Returns the value of theinline
record component.- Returns:
- the value of the
inline
record component
-