All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.seratch.jslack.api.model.block.composition.BlockCompositions Maven / Gradle / Ivy

package com.github.seratch.jslack.api.model.block.composition;

import com.github.seratch.jslack.api.model.ModelConfigurator;

import java.util.Arrays;
import java.util.List;

public class BlockCompositions {

    private BlockCompositions() {
    }

    public static List asSectionFields(TextObject... elements) {
        return Arrays.asList(elements);
    }

    public static List asOptionGroups(OptionGroupObject... optionGroups) {
        return Arrays.asList(optionGroups);
    }

    public static List asOptions(OptionObject... options) {
        return Arrays.asList(options);
    }

    // ConfirmationDialogObject

    public static ConfirmationDialogObject confirmationDialog(
            ModelConfigurator configurator) {
        return configurator.configure(ConfirmationDialogObject.builder()).build();
    }

    // PlainTextObject

    public static PlainTextObject plainText(
            ModelConfigurator configurator) {
        return configurator.configure(PlainTextObject.builder()).build();
    }

    public static PlainTextObject plainText(String text) {
        return PlainTextObject.builder().text(text).build();
    }

    public static PlainTextObject plainText(String text, boolean emoji) {
        return PlainTextObject.builder().text(text).emoji(emoji).build();
    }

    // MarkdownTextObject

    public static MarkdownTextObject markdownText(ModelConfigurator configurator) {
        return configurator.configure(MarkdownTextObject.builder()).build();
    }

    public static MarkdownTextObject markdownText(String text) {
        return MarkdownTextObject.builder().text(text).build();
    }

    // OptionGroupObject

    public static OptionGroupObject optionGroup(ModelConfigurator configurator) {
        return configurator.configure(OptionGroupObject.builder()).build();
    }

    // OptionObject

    public static OptionObject option(ModelConfigurator configurator) {
        return configurator.configure(OptionObject.builder()).build();
    }

    public static OptionObject option(PlainTextObject text, String value) {
        return OptionObject.builder().text(text).value(value).build();
    }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy