Interface Embed.Fields

Enclosing class:
Embed

public static interface Embed.Fields
Methods for manipulating the fields of an Embed.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Embed.Fields
    add(boolean inline)
    Adds a blank (empty) Field to the embed.
    default Embed.Fields
    add(String name, String value)
    Adds a Field to the embed that isn't inlined.
    add(String name, String value, boolean inline)
    Adds a Field to the embed.
    default Embed.Fields
    add(@Nullable net.dv8tion.jda.api.entities.MessageEmbed.Field field)
    Copies the provided Field into a new Field for this builder.
    default Embed.Fields
    Clears all fields from the embed.
    default Embed.Fields
    remove(String value)
    Removes all fields with the given value.
    default Embed.Fields
    remove(String name, String value)
    Removes all fields with the given name and value.
    default Embed.Fields
    Removes all fields with the given name.
    default Embed.Fields
    removeIf(String name, Predicate<net.dv8tion.jda.api.entities.MessageEmbed.Field> filter)
    Removes all fields with the given name of this embed based on the given Predicate.
    removeIf(Predicate<net.dv8tion.jda.api.entities.MessageEmbed.Field> filter)
    Removes all fields of this embed based on the given Predicate.
    default Embed.Fields
    replace(String name, net.dv8tion.jda.api.entities.MessageEmbed.Field field)
    Replaces all fields of this embed with the given MessageEmbed.Field based on the given name.
    replace(Predicate<net.dv8tion.jda.api.entities.MessageEmbed.Field> filter, net.dv8tion.jda.api.entities.MessageEmbed.Field field)
    Replaces all fields of this embed based on the Predicate with the given MessageEmbed.Field.
    default Embed.Fields
    replaceByValue(String value, net.dv8tion.jda.api.entities.MessageEmbed.Field field)
    Replaces all fields of this embed with the given MessageEmbed.Field based on the given value.
  • Method Details

    • add

      default Embed.Fields add(String name, String value)
      Adds a Field to the embed that isn't inlined.
      Parameters:
      name - the name of the Field, displayed in bold above the value.
      value - the contents of the field.
      Returns:
      this instance for fluent interface
    • add

      default Embed.Fields add(@Nullable net.dv8tion.jda.api.entities.MessageEmbed.Field field)

      Copies the provided Field into a new Field for this builder.

      For additional documentation, see add(String,String,boolean)

      Parameters:
      field - the field object to add
      Returns:
      the builder after the field has been added
    • add

      default Embed.Fields add(boolean inline)

      Adds a blank (empty) Field to the embed.

      Example of Inline Example of Non-inline

      Parameters:
      inline - whether this field should display inline
      Returns:
      the builder after the field has been added
    • add

      Embed.Fields add(String name, String value, boolean inline)

      Adds a Field to the embed.

      Note: If a blank string is provided to either name or value, the blank string is replaced with EmbedBuilder.ZERO_WIDTH_SPACE.

      Example of Inline Example of Non-inline

      Parameters:
      name - the name of the Field, displayed in bold above the value.
      value - the contents of the field.
      inline - whether this field should display inline.
      Returns:
      the builder after the field has been added
      Throws:
      IllegalArgumentException -
      • If null is provided - If the character limit of 256 for name is exceeded. - If the character limit of 1024 for value is exceeded.
    • removeIf

      default Embed.Fields removeIf(String name, Predicate<net.dv8tion.jda.api.entities.MessageEmbed.Field> filter)
      Removes all fields with the given name of this embed based on the given Predicate.
      Parameters:
      name - the name of the fields to test
      filter - the Predicate to test the fields with
      Returns:
      this instance for fluent interface
    • remove

      default Embed.Fields remove(String value)
      Removes all fields with the given value.
      Parameters:
      value - the value of a field that should be removed
      Returns:
      this instance for fluent interface
    • removeByName

      default Embed.Fields removeByName(String name)
      Removes all fields with the given name.
      Parameters:
      name - the name of a field that should be removed
      Returns:
      this instance for fluent interface
    • remove

      default Embed.Fields remove(String name, String value)
      Removes all fields with the given name and value.
      Parameters:
      name - the name of the field that should be removed
      value - the value of the field that should be removed
      Returns:
      this instance for fluent interface
    • clear

      default Embed.Fields clear()
      Clears all fields from the embed.
      Returns:
      this instance for fluent interface
    • removeIf

      Embed.Fields removeIf(Predicate<net.dv8tion.jda.api.entities.MessageEmbed.Field> filter)
      Removes all fields of this embed based on the given Predicate.
      Parameters:
      filter - the Predicate to test the fields with
      Returns:
      this instance for fluent interface
    • replace

      default Embed.Fields replace(String name, net.dv8tion.jda.api.entities.MessageEmbed.Field field)
      Replaces all fields of this embed with the given MessageEmbed.Field based on the given name.
      Parameters:
      name - the name of a field that should be replaced
      field - the new MessageEmbed.Field to replace the old value with
      Returns:
      this instance for fluent interface
    • replaceByValue

      default Embed.Fields replaceByValue(String value, net.dv8tion.jda.api.entities.MessageEmbed.Field field)
      Replaces all fields of this embed with the given MessageEmbed.Field based on the given value.
      Parameters:
      value - the value of a field that should be replaced
      field - the new MessageEmbed.Field to replace the old value with
      Returns:
      this instance for fluent interface
    • replace

      Embed.Fields replace(Predicate<net.dv8tion.jda.api.entities.MessageEmbed.Field> filter, net.dv8tion.jda.api.entities.MessageEmbed.Field field)
      Replaces all fields of this embed based on the Predicate with the given MessageEmbed.Field.
      Parameters:
      filter - the Predicate to test the fields with
      field - the new MessageEmbed.Field to replace the old values with
      Returns:
      this instance for fluent interface