Skip to content

Commit

Permalink
Changed addField String name and String Value to Nonnull (#2133)
Browse files Browse the repository at this point in the history
  • Loading branch information
RealYusufIsmail authored May 20, 2022
1 parent bb41349 commit 51aba0b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/net/dv8tion/jda/api/EmbedBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ public EmbedBuilder addField(@Nullable MessageEmbed.Field field)
*
* @throws java.lang.IllegalArgumentException
* <ul>
* <li>If only {@code name} or {@code value} is set. Both must be set.</li>
* <li>If {@code null} is provided</li>
* <li>If the character limit for {@code name}, defined by {@link net.dv8tion.jda.api.entities.MessageEmbed#TITLE_MAX_LENGTH} as {@value net.dv8tion.jda.api.entities.MessageEmbed#TITLE_MAX_LENGTH},
* is exceeded.</li>
* <li>If the character limit for {@code value}, defined by {@link net.dv8tion.jda.api.entities.MessageEmbed#VALUE_MAX_LENGTH} as {@value net.dv8tion.jda.api.entities.MessageEmbed#VALUE_MAX_LENGTH},
Expand All @@ -750,10 +750,10 @@ public EmbedBuilder addField(@Nullable MessageEmbed.Field field)
* @return the builder after the field has been added
*/
@Nonnull
public EmbedBuilder addField(@Nullable String name, @Nullable String value, boolean inline)
public EmbedBuilder addField(@Nonnull String name, @Nonnull String value, boolean inline)
{
if (name == null && value == null)
return this;
Checks.notNull(name, "Name");
Checks.notNull(value, "Value");
this.fields.add(new MessageEmbed.Field(name, value, inline));
return this;
}
Expand Down

0 comments on commit 51aba0b

Please sign in to comment.