org.ergoplatform.appkit.BoxAttachmentPlainText Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ergo-appkit_2.11 Show documentation
Show all versions of ergo-appkit_2.11 Show documentation
A Library for Polyglot Development of Ergo Applications
The newest version!
package org.ergoplatform.appkit;
import java.nio.charset.StandardCharsets;
/**
* EIP-29 attachment containing a simple text
*/
public class BoxAttachmentPlainText extends BoxAttachmentGeneric {
private final String text;
public BoxAttachmentPlainText(byte[] attachmentContent) {
super(Type.PLAIN_TEXT.toTypeRawValue(), attachmentContent);
text = new String(attachmentContent, StandardCharsets.UTF_8);
}
/**
* @return text, attachment content
*/
public String getText() {
return text;
}
public static BoxAttachmentPlainText buildForText(String text) {
return new BoxAttachmentPlainText(text.getBytes(StandardCharsets.UTF_8));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy