-
public class AttachmentFactoryHolds the information required to build an attachment message.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceAttachmentFactory.TypeThe type of the attachment factory.
-
Field Summary
Fields Modifier and Type Field Description private final Function1<List<Attachment>, Boolean>canHandleprivate final Function3<Modifier, List<Attachment>, Function1<Attachment, Unit>, Unit>previewContentprivate final Function2<Modifier, AttachmentState, Unit>contentprivate final Function1<Attachment, String>textFormatterprivate final AttachmentFactory.Typetype
-
Constructor Summary
Constructors Constructor Description AttachmentFactory(Function1<List<Attachment>, Boolean> canHandle, Function3<Modifier, List<Attachment>, Function1<Attachment, Unit>, Unit> previewContent, Function2<Modifier, AttachmentState, Unit> content, Function1<Attachment, String> textFormatter, AttachmentFactory.Type type)
-
Method Summary
Modifier and Type Method Description final Function1<List<Attachment>, Boolean>getCanHandle()final Function3<Modifier, List<Attachment>, Function1<Attachment, Unit>, Unit>getPreviewContent()final Function2<Modifier, AttachmentState, Unit>getContent()final Function1<Attachment, String>getTextFormatter()final AttachmentFactory.TypegetType()-
-
Constructor Detail
-
AttachmentFactory
AttachmentFactory(Function1<List<Attachment>, Boolean> canHandle, Function3<Modifier, List<Attachment>, Function1<Attachment, Unit>, Unit> previewContent, Function2<Modifier, AttachmentState, Unit> content, Function1<Attachment, String> textFormatter, AttachmentFactory.Type type)
- Parameters:
canHandle- Checks the message and returns if the factory can consume it or not.previewContent- Composable function that allows users to define the content the AttachmentFactory will build, using any given AttachmentState, when the message is displayed in the message input preview, before sending.content- Composable function that allows users to define the content the AttachmentFactory will build using any given AttachmentState, when the message is displayed in the message list.textFormatter- The formatter used to get a string representation for the given attachment.
-
-
Method Detail
-
getCanHandle
final Function1<List<Attachment>, Boolean> getCanHandle()
-
getPreviewContent
final Function3<Modifier, List<Attachment>, Function1<Attachment, Unit>, Unit> getPreviewContent()
-
getContent
final Function2<Modifier, AttachmentState, Unit> getContent()
-
getTextFormatter
final Function1<Attachment, String> getTextFormatter()
-
getType
final AttachmentFactory.Type getType()
-
-
-
-