com.slack.api.model.block.element.BlockElements Maven / Gradle / Ivy
package com.slack.api.model.block.element;
import com.slack.api.model.ModelConfigurator;
import com.slack.api.model.block.ContextBlockElement;
import java.util.Arrays;
import java.util.List;
public class BlockElements {
private BlockElements() {
}
public static List asElements(BlockElement... elements) {
return Arrays.asList(elements);
}
public static List asContextElements(ContextBlockElement... elements) {
return Arrays.asList(elements);
}
public static List asRichTextElements(RichTextElement... elements) {
return Arrays.asList(elements);
}
// WorkflowButtonElement
public static WorkflowButtonElement workflowButton(ModelConfigurator configurator) {
return configurator.configure(WorkflowButtonElement.builder()).build();
}
// ButtonElement
public static ButtonElement button(ModelConfigurator configurator) {
return configurator.configure(ButtonElement.builder()).build();
}
// CheckboxesElement
public static CheckboxesElement checkboxes(ModelConfigurator configurator) {
return configurator.configure(CheckboxesElement.builder()).build();
}
// OverflowMenuElement
public static OverflowMenuElement overflowMenu(ModelConfigurator configurator) {
return configurator.configure(OverflowMenuElement.builder()).build();
}
// RichTextInputElement
public static RichTextInputElement richTextInput(ModelConfigurator configurator) {
return configurator.configure(RichTextInputElement.builder()).build();
}
// PlainTextInputElement
public static PlainTextInputElement plainTextInput(ModelConfigurator configurator) {
return configurator.configure(PlainTextInputElement.builder()).build();
}
public static EmailTextInputElement emailTextInput(ModelConfigurator configurator) {
return configurator.configure(EmailTextInputElement.builder()).build();
}
public static URLTextInputElement urlTextInput(ModelConfigurator configurator) {
return configurator.configure(URLTextInputElement.builder()).build();
}
public static NumberInputElement numberInput(ModelConfigurator configurator) {
return configurator.configure(NumberInputElement.builder()).build();
}
public static FileInputElement fileInput(ModelConfigurator configurator) {
return configurator.configure(FileInputElement.builder()).build();
}
// DatePickerElement
public static DatePickerElement datePicker(ModelConfigurator configurator) {
return configurator.configure(DatePickerElement.builder()).build();
}
// TimePickerElement
public static TimePickerElement timePicker(ModelConfigurator configurator) {
return configurator.configure(TimePickerElement.builder()).build();
}
// DatetimePickerElement
public static DatetimePickerElement datetimePicker(ModelConfigurator configurator) {
return configurator.configure(DatetimePickerElement.builder()).build();
}
// ImageElement
public static ImageElement image(ModelConfigurator configurator) {
return configurator.configure(ImageElement.builder()).build();
}
// NOTE: just as an alias to avoid conflict with Blocks.image()
public static ImageElement imageElement(ModelConfigurator configurator) {
return image(configurator);
}
// RadioButtonsElement
public static RadioButtonsElement radioButtons(ModelConfigurator configurator) {
return configurator.configure(RadioButtonsElement.builder()).build();
}
// ------------------------------------------------
// Select Elements
// ------------------------------------------------
// ChannelsSelectElement
public static ChannelsSelectElement channelsSelect(ModelConfigurator configurator) {
return configurator.configure(ChannelsSelectElement.builder()).build();
}
// ConversationsSelectElement
public static ConversationsSelectElement conversationsSelect(ModelConfigurator configurator) {
return configurator.configure(ConversationsSelectElement.builder()).build();
}
// ExternalSelectElement
public static ExternalSelectElement externalSelect(ModelConfigurator configurator) {
return configurator.configure(ExternalSelectElement.builder()).build();
}
// StaticSelectElement
public static StaticSelectElement staticSelect(ModelConfigurator configurator) {
return configurator.configure(StaticSelectElement.builder()).build();
}
// UsersSelectElement
public static UsersSelectElement usersSelect(ModelConfigurator configurator) {
return configurator.configure(UsersSelectElement.builder()).build();
}
// ------------------------------------------------
// Multi Select Elements
// ------------------------------------------------
// MultiChannelsSelectElement
public static MultiChannelsSelectElement multiChannelsSelect(ModelConfigurator configurator) {
return configurator.configure(MultiChannelsSelectElement.builder()).build();
}
// MultiConversationsSelectElement
public static MultiConversationsSelectElement multiConversationsSelect(ModelConfigurator configurator) {
return configurator.configure(MultiConversationsSelectElement.builder()).build();
}
// MultiExternalSelectElement
public static MultiExternalSelectElement multiExternalSelect(ModelConfigurator configurator) {
return configurator.configure(MultiExternalSelectElement.builder()).build();
}
// MultiUsersSelectElement
public static MultiUsersSelectElement multiUsersSelect(ModelConfigurator configurator) {
return configurator.configure(MultiUsersSelectElement.builder()).build();
}
// MultiStaticSelectElement
public static MultiStaticSelectElement multiStaticSelect(ModelConfigurator configurator) {
return configurator.configure(MultiStaticSelectElement.builder()).build();
}
// ------------------------------------------------
// Rich Text Elements
// ------------------------------------------------
// RichTextListElement
public static RichTextListElement richTextList(ModelConfigurator configurator) {
return configurator.configure(RichTextListElement.builder()).build();
}
// RichTextPreformattedElement
public static RichTextPreformattedElement richTextPreformatted(ModelConfigurator configurator) {
return configurator.configure(RichTextPreformattedElement.builder()).build();
}
// RichTextQuoteElement
public static RichTextQuoteElement richTextQuote(ModelConfigurator configurator) {
return configurator.configure(RichTextQuoteElement.builder()).build();
}
// RichTextSectionElement
public static RichTextSectionElement richTextSection(ModelConfigurator configurator) {
return configurator.configure(RichTextSectionElement.builder()).build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy