pro.zackpollard.telegrambot.api.internal.chat.message.content.DocumentContentImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jtelegram-botapi Show documentation
Show all versions of jtelegram-botapi Show documentation
The Java Telegram Bot API is a wrapper for the Telegram HTTP Bot API
package pro.zackpollard.telegrambot.api.internal.chat.message.content;
import org.json.JSONObject;
import pro.zackpollard.telegrambot.api.chat.message.content.DocumentContent;
import pro.zackpollard.telegrambot.api.chat.message.content.type.Document;
import pro.zackpollard.telegrambot.api.internal.chat.message.content.type.DocumentImpl;
/**
* @author Zack Pollard
*/
public class DocumentContentImpl implements DocumentContent {
private final Document content;
private final String caption;
private DocumentContentImpl(JSONObject jsonObject, String caption) {
this.content = DocumentImpl.createDocument(jsonObject);
this.caption = caption;
}
public static DocumentContent createDocumentContent(JSONObject jsonObject, String caption) {
return jsonObject != null ? new DocumentContentImpl(jsonObject, caption) : null;
}
@Override
public Document getContent() {
return content;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy