public abstract class InputMedia<T> extends Object implements InputBotApiObject, Validable
| Modifier and Type | Field and Description |
|---|---|
protected static String |
TYPE_FIELD |
| Constructor and Description |
|---|
InputMedia() |
InputMedia(String media,
String caption) |
| Modifier and Type | Method and Description |
|---|---|
String |
getCaption() |
String |
getMedia() |
File |
getMediaFile() |
String |
getMediaName() |
InputStream |
getNewMediaStream() |
String |
getParseMode() |
abstract String |
getType() |
boolean |
isNewMedia() |
InputMedia |
setCaption(String caption) |
T |
setMedia(File mediaFile,
String fileName)
Use this setter to send new file.
|
T |
setMedia(InputStream mediaStream,
String fileName)
Use this setter to send new file as stream.
|
T |
setMedia(String media)
Use this setter to send an existing file (using file_id) or an url.
|
InputMedia<T> |
setParseMode(String parseMode) |
void |
validate()
Validates that mandatory fields are filled and optional objects
|
protected static final String TYPE_FIELD
public String getMedia()
public File getMediaFile()
public InputStream getNewMediaStream()
public String getMediaName()
public boolean isNewMedia()
public T setMedia(String media)
media - File_id or URL of the file to sendpublic T setMedia(File mediaFile, String fileName)
mediaFile - File to sendpublic T setMedia(InputStream mediaStream, String fileName)
mediaStream - File to sendpublic String getCaption()
public InputMedia setCaption(String caption)
public String getParseMode()
public InputMedia<T> setParseMode(String parseMode)
public void validate()
throws TelegramApiValidationException
Validablevalidate in interface ValidableTelegramApiValidationException - If any mandatory field is emptypublic abstract String getType()
Copyright © 2018. All rights reserved.