Package dev.sympho.bot_utils.event.reply
Class ReplyEditSpec.Builder
java.lang.Object
dev.sympho.bot_utils.event.reply.ReplyEditSpec.Builder
- Enclosing class:
- ReplyEditSpec
Builds instances of type
ReplyEditSpec.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionaddAllAttachments(Collection<? extends Attachment> elements) addAllComponents(Collection<? extends LayoutComponent> elements) addAllEmbeds(Collection<? extends EmbedCreateSpec> elements) addAllFiles(Iterable<? extends MessageCreateFields.File> files) addAllFileSpoilers(Iterable<? extends MessageCreateFields.FileSpoiler> files) addAttachment(Attachment element) addComponent(LayoutComponent element) addEmbed(EmbedCreateSpec element) addFile(MessageCreateFields.File... files) allowedMentions(discord4j.discordjson.possible.Possible<Optional<discord4j.rest.util.AllowedMentions>> value) allowedMentions(discord4j.rest.util.AllowedMentions value) Deprecated.allowedMentionsOrNull(discord4j.rest.util.AllowedMentions value) attachments(discord4j.discordjson.possible.Possible<? extends Optional<? extends Collection<? extends Attachment>>> elements) attachments(Iterable<Attachment> elements) Deprecated.final ReplyEditSpec.BuilderattachmentsOrNull(Attachment... elements) attachmentsOrNull(Iterable<? extends Attachment> elements) build()Builds a newReplyEditSpec.components(discord4j.discordjson.possible.Possible<? extends Optional<? extends Collection<? extends LayoutComponent>>> elements) components(Iterable<LayoutComponent> elements) Deprecated.final ReplyEditSpec.BuildercomponentsOrNull(LayoutComponent... elements) componentsOrNull(Iterable<? extends LayoutComponent> elements) Deprecated.contentOrNull(String value) embeds(discord4j.discordjson.possible.Possible<? extends Optional<? extends Collection<? extends EmbedCreateSpec>>> elements) embeds(Iterable<EmbedCreateSpec> elements) Deprecated.final ReplyEditSpec.BuilderembedsOrNull(EmbedCreateSpec... elements) embedsOrNull(Iterable<? extends EmbedCreateSpec> elements) files(Iterable<? extends MessageCreateFields.File> files) fileSpoilers(Iterable<? extends MessageCreateFields.FileSpoiler> files) final ReplyEditSpec.Builderfrom(ReplyEditSpec instance) Fill a builder with attribute values from the providedReplyEditSpecinstance.
-
Method Details
-
from
Fill a builder with attribute values from the providedReplyEditSpecinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
content
@CanIgnoreReturnValue public ReplyEditSpec.Builder content(discord4j.discordjson.possible.Possible<Optional<String>> value) -
content
Deprecated. -
contentOrNull
-
addEmbed
-
addAllEmbeds
@CanIgnoreReturnValue public ReplyEditSpec.Builder addAllEmbeds(Collection<? extends EmbedCreateSpec> elements) -
embeds
@CanIgnoreReturnValue public ReplyEditSpec.Builder embeds(discord4j.discordjson.possible.Possible<? extends Optional<? extends Collection<? extends EmbedCreateSpec>>> elements) -
embeds
@Deprecated @CanIgnoreReturnValue public ReplyEditSpec.Builder embeds(@Nullable Iterable<EmbedCreateSpec> elements) Deprecated. -
embedsOrNull
@CanIgnoreReturnValue public ReplyEditSpec.Builder embedsOrNull(@Nullable Iterable<? extends EmbedCreateSpec> elements) -
embedsOrNull
@SafeVarargs @CanIgnoreReturnValue public final ReplyEditSpec.Builder embedsOrNull(EmbedCreateSpec... elements) -
files
@CanIgnoreReturnValue public ReplyEditSpec.Builder files(Iterable<? extends MessageCreateFields.File> files) -
addFile
-
addAllFiles
@CanIgnoreReturnValue public ReplyEditSpec.Builder addAllFiles(Iterable<? extends MessageCreateFields.File> files) -
fileSpoilers
@CanIgnoreReturnValue public ReplyEditSpec.Builder fileSpoilers(Iterable<? extends MessageCreateFields.FileSpoiler> files) -
addFileSpoiler
@CanIgnoreReturnValue public ReplyEditSpec.Builder addFileSpoiler(MessageCreateFields.FileSpoiler... files) -
addAllFileSpoilers
@CanIgnoreReturnValue public ReplyEditSpec.Builder addAllFileSpoilers(Iterable<? extends MessageCreateFields.FileSpoiler> files) -
allowedMentions
@CanIgnoreReturnValue public ReplyEditSpec.Builder allowedMentions(discord4j.discordjson.possible.Possible<Optional<discord4j.rest.util.AllowedMentions>> value) -
allowedMentions
@Deprecated @CanIgnoreReturnValue public ReplyEditSpec.Builder allowedMentions(@Nullable discord4j.rest.util.AllowedMentions value) Deprecated. -
allowedMentionsOrNull
@CanIgnoreReturnValue public ReplyEditSpec.Builder allowedMentionsOrNull(@Nullable discord4j.rest.util.AllowedMentions value) -
addComponent
-
addAllComponents
@CanIgnoreReturnValue public ReplyEditSpec.Builder addAllComponents(Collection<? extends LayoutComponent> elements) -
components
@CanIgnoreReturnValue public ReplyEditSpec.Builder components(discord4j.discordjson.possible.Possible<? extends Optional<? extends Collection<? extends LayoutComponent>>> elements) -
components
@Deprecated @CanIgnoreReturnValue public ReplyEditSpec.Builder components(@Nullable Iterable<LayoutComponent> elements) Deprecated. -
componentsOrNull
@CanIgnoreReturnValue public ReplyEditSpec.Builder componentsOrNull(@Nullable Iterable<? extends LayoutComponent> elements) -
componentsOrNull
@SafeVarargs @CanIgnoreReturnValue public final ReplyEditSpec.Builder componentsOrNull(LayoutComponent... elements) -
addAttachment
-
addAllAttachments
@CanIgnoreReturnValue public ReplyEditSpec.Builder addAllAttachments(Collection<? extends Attachment> elements) -
attachments
@CanIgnoreReturnValue public ReplyEditSpec.Builder attachments(discord4j.discordjson.possible.Possible<? extends Optional<? extends Collection<? extends Attachment>>> elements) -
attachments
@Deprecated @CanIgnoreReturnValue public ReplyEditSpec.Builder attachments(@Nullable Iterable<Attachment> elements) Deprecated. -
attachmentsOrNull
@CanIgnoreReturnValue public ReplyEditSpec.Builder attachmentsOrNull(@Nullable Iterable<? extends Attachment> elements) -
attachmentsOrNull
@SafeVarargs @CanIgnoreReturnValue public final ReplyEditSpec.Builder attachmentsOrNull(Attachment... elements) -
build
Builds a newReplyEditSpec.- Returns:
- An immutable instance of ReplyEditSpec
- Throws:
IllegalStateException- if any required attributes are missing
-