Class ComponentSerializer

java.lang.Object
net.dv8tion.jda.api.components.utils.ComponentSerializer

public class ComponentSerializer extends Object
Utility class to serialize a list of Components into DataObject.

Since some components include implicit file uploads, such as FileDisplay and Thumbnail, the included FileUpload instances can be accessed using getFileUploads(Collection).
Each uploaded file is referenced in the respective components using attachment://filename.

This separation is done to simplify persistence of these components in preferred formats. For instance, you might want to store the components as JSON Blobs but the files in an object storage.

You can use ComponentDeserializer to deserialize the output again, make sure you also provide any implicit FileUpload instances.

See Also: