methods classes: setters to builder style

This commit is contained in:
Alexander Babai 2016-04-12 22:25:54 +03:00
parent b9d997fddc
commit 0e36784cbe
22 changed files with 205 additions and 102 deletions

View File

@ -44,56 +44,63 @@ public class AnswerInlineQuery extends BotApiMethod<Boolean> {
return inlineQueryId;
}
public void setInlineQueryId(String inlineQueryId) {
public AnswerInlineQuery setInlineQueryId(String inlineQueryId) {
this.inlineQueryId = inlineQueryId;
return this;
}
public List<InlineQueryResult> getResults() {
return results;
}
public void setResults(List<InlineQueryResult> results) {
public AnswerInlineQuery setResults(List<InlineQueryResult> results) {
this.results = results;
return this;
}
public Integer getCacheTime() {
return cacheTime;
}
public void setCacheTime(Integer cacheTime) {
public AnswerInlineQuery setCacheTime(Integer cacheTime) {
this.cacheTime = cacheTime;
return this;
}
public Boolean getPersonal() {
return isPersonal;
}
public void setPersonal(Boolean personal) {
public AnswerInlineQuery setPersonal(Boolean personal) {
isPersonal = personal;
return this;
}
public String getNextOffset() {
return nextOffset;
}
public void setNextOffset(String nextOffset) {
public AnswerInlineQuery setNextOffset(String nextOffset) {
this.nextOffset = nextOffset;
return this;
}
public String getSwitchPmText() {
return switchPmText;
}
public void setSwitchPmText(String switchPmText) {
public AnswerInlineQuery setSwitchPmText(String switchPmText) {
this.switchPmText = switchPmText;
return this;
}
public String getSwitchPmParameter() {
return switchPmParameter;
}
public void setSwitchPmParameter(String switchPmParameter) {
public AnswerInlineQuery setSwitchPmParameter(String switchPmParameter) {
this.switchPmParameter = switchPmParameter;
return this;
}
@Override

View File

@ -42,24 +42,27 @@ public class ForwardMessage extends BotApiMethod<Message> {
return chatId;
}
public void setChatId(String chatId) {
public ForwardMessage setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public Integer getFromChatId() {
return fromChatId;
}
public void setFromChatId(Integer fromChatId) {
public ForwardMessage setFromChatId(Integer fromChatId) {
this.fromChatId = fromChatId;
return this;
}
public Integer getMessageId() {
return messageId;
}
public void setMessageId(Integer messageId) {
public ForwardMessage setMessageId(Integer messageId) {
this.messageId = messageId;
return this;
}
public Boolean getDisableNotification() {

View File

@ -36,8 +36,9 @@ public class GetFile extends BotApiMethod<File> {
return fileId;
}
public void setFileId(String fileId) {
public GetFile setFileId(String fileId) {
this.fileId = fileId;
return this;
}
@Override

View File

@ -41,25 +41,29 @@ public class GetUserProfilePhotos extends BotApiMethod<UserProfilePhotos> {
return userId;
}
public void setUserId(Integer userId) {
public GetUserProfilePhotos setUserId(Integer userId) {
this.userId = userId;
return this;
}
public Integer getOffset() {
return offset;
}
public void setOffset(Integer offset) {
public GetUserProfilePhotos setOffset(Integer offset) {
this.offset = offset;
return this;
}
public Integer getLimit() {
return limit;
}
public void setLimit(Integer limit) {
public GetUserProfilePhotos setLimit(Integer limit) {
this.limit = limit;
return this;
}
@Override
public JSONObject toJson() {
JSONObject jsonObject = new JSONObject();

View File

@ -38,16 +38,18 @@ public class KickChatMember extends BotApiMethod<Boolean> {
return chatId;
}
public void setChatId(String chatId) {
public KickChatMember setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
public KickChatMember setUserId(Integer userId) {
this.userId = userId;
return this;
}
@Override

View File

@ -34,16 +34,18 @@ public class UnbanChatMember extends BotApiMethod<Boolean> {
return chatId;
}
public void setChatId(String chatId) {
public UnbanChatMember setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
public UnbanChatMember setUserId(Integer userId) {
this.userId = userId;
return this;
}
@Override

View File

@ -47,16 +47,18 @@ public class SendAudio {
return this.duration;
}
public void setDuration(Integer duration) {
public SendAudio setDuration(Integer duration) {
this.duration = duration;
return this;
}
public String getChatId() {
return chatId;
}
public void setChatId(String chatId) {
public SendAudio setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public String getAudio() {
@ -69,9 +71,10 @@ public class SendAudio {
* @param audio File_id of the audio to send
* @note The file_id must have already been received or sent by your bot
*/
public void setAudio(String audio) {
public SendAudio setAudio(String audio) {
this.audio = audio;
this.isNewAudio = false;
return this;
}
/**
@ -80,42 +83,47 @@ public class SendAudio {
* @param audio Path to the new file in your server
* @param audioName Name of the file itself
*/
public void setNewAudio(String audio, String audioName) {
public SendAudio setNewAudio(String audio, String audioName) {
this.audio = audio;
this.isNewAudio = true;
this.audioName = audioName;
return this;
}
public Integer getReplayToMessageId() {
return replayToMessageId;
}
public void setReplayToMessageId(Integer replayToMessageId) {
public SendAudio setReplayToMessageId(Integer replayToMessageId) {
this.replayToMessageId = replayToMessageId;
return this;
}
public ReplyKeyboard getReplayMarkup() {
return replayMarkup;
}
public void setReplayMarkup(ReplyKeyboard replayMarkup) {
public SendAudio setReplayMarkup(ReplyKeyboard replayMarkup) {
this.replayMarkup = replayMarkup;
return this;
}
public String getPerformer() {
return performer;
}
public void setPerformer(String performer) {
public SendAudio setPerformer(String performer) {
this.performer = performer;
return this;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
public SendAudio setTitle(String title) {
this.title = title;
return this;
}
public Boolean getDisableNotification() {

View File

@ -37,16 +37,18 @@ public class SendChatAction extends BotApiMethod<Boolean> {
return chatId;
}
public void setChatId(String chatId) {
public SendChatAction setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public String getAction() {
return action;
}
public void setAction(String action) {
public SendChatAction setAction(String action) {
this.action = action;
return this;
}
@Override

View File

@ -45,24 +45,27 @@ public class SendContact extends BotApiMethod<Message> {
return chatId;
}
public void setChatId(String chatId) {
public SendContact setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public Integer getReplayToMessageId() {
return replayToMessageId;
}
public void setReplayToMessageId(Integer replayToMessageId) {
public SendContact setReplayToMessageId(Integer replayToMessageId) {
this.replayToMessageId = replayToMessageId;
return this;
}
public ReplyKeyboard getReplayMarkup() {
return replayMarkup;
}
public void setReplayMarkup(ReplyKeyboard replayMarkup) {
public SendContact setReplayMarkup(ReplyKeyboard replayMarkup) {
this.replayMarkup = replayMarkup;
return this;
}
public Boolean getDisableNotification() {
@ -81,24 +84,27 @@ public class SendContact extends BotApiMethod<Message> {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
public SendContact setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
return this;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
public SendContact setFirstName(String firstName) {
this.firstName = firstName;
return this;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
public SendContact setLastName(String lastName) {
this.lastName = lastName;
return this;
}
@Override

View File

@ -39,23 +39,26 @@ public class SendDocument {
return chatId;
}
public void setChatId(String chatId) {
public SendDocument setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public String getDocument() {
return document;
}
public void setDocument(String document) {
public SendDocument setDocument(String document) {
this.document = document;
this.isNewDocument = false;
return this;
}
public void setNewDocument(String document, String documentName) {
public SendDocument setNewDocument(String document, String documentName) {
this.document = document;
this.isNewDocument = true;
this.documentName = documentName;
return this;
}
public boolean isNewDocument() {
@ -70,8 +73,9 @@ public class SendDocument {
return replayToMessageId;
}
public void setReplayToMessageId(Integer replayToMessageId) {
public SendDocument setReplayToMessageId(Integer replayToMessageId) {
this.replayToMessageId = replayToMessageId;
return this;
}
public Boolean getDisableNotification() {
@ -90,16 +94,18 @@ public class SendDocument {
return caption;
}
public void setCaption(String caption) {
public SendDocument setCaption(String caption) {
this.caption = caption;
return this;
}
public ReplyKeyboard getReplayMarkup() {
return replayMarkup;
}
public void setReplayMarkup(ReplyKeyboard replayMarkup) {
public SendDocument setReplayMarkup(ReplyKeyboard replayMarkup) {
this.replayMarkup = replayMarkup;
return this;
}
@Override

View File

@ -42,40 +42,45 @@ public class SendLocation extends BotApiMethod<Message> {
return chatId;
}
public void setChatId(String chatId) {
public SendLocation setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public Float getLatitude() {
return latitude;
}
public void setLatitude(Float latitude) {
public SendLocation setLatitude(Float latitude) {
this.latitude = latitude;
return this;
}
public Float getLongitude() {
return longitude;
}
public void setLongitude(Float longitude) {
public SendLocation setLongitude(Float longitude) {
this.longitude = longitude;
return this;
}
public Integer getReplayToMessageId() {
return replayToMessageId;
}
public void setReplayToMessageId(Integer replayToMessageId) {
public SendLocation setReplayToMessageId(Integer replayToMessageId) {
this.replayToMessageId = replayToMessageId;
return this;
}
public ReplyKeyboard getReplayMarkup() {
return replayMarkup;
}
public void setReplayMarkup(ReplyKeyboard replayMarkup) {
public SendLocation setReplayMarkup(ReplyKeyboard replayMarkup) {
this.replayMarkup = replayMarkup;
return this;
}
public Boolean getDisableNotification() {

View File

@ -49,32 +49,36 @@ public class SendMessage extends BotApiMethod<Message> {
return chatId;
}
public void setChatId(String chatId) {
public SendMessage setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public String getText() {
return text;
}
public void setText(String text) {
public SendMessage setText(String text) {
this.text = text;
return this;
}
public Integer getReplayToMessageId() {
return replayToMessageId;
}
public void setReplayToMessageId(Integer replayToMessageId) {
public SendMessage setReplayToMessageId(Integer replayToMessageId) {
this.replayToMessageId = replayToMessageId;
return this;
}
public ReplyKeyboard getReplayMarkup() {
return replayMarkup;
}
public void setReplayMarkup(ReplyKeyboard replayMarkup) {
public SendMessage setReplayMarkup(ReplyKeyboard replayMarkup) {
this.replayMarkup = replayMarkup;
return this;
}
public Boolean getDisableWebPagePreview() {

View File

@ -40,41 +40,46 @@ public class SendPhoto {
return chatId;
}
public void setChatId(String chatId) {
public SendPhoto setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public String getPhoto() {
return photo;
}
public void setPhoto(String photo) {
public SendPhoto setPhoto(String photo) {
this.photo = photo;
this.isNewPhoto = false;
return this;
}
public String getCaption() {
return caption;
}
public void setCaption(String caption) {
public SendPhoto setCaption(String caption) {
this.caption = caption;
return this;
}
public Integer getReplayToMessageId() {
return replayToMessageId;
}
public void setReplayToMessageId(Integer replayToMessageId) {
public SendPhoto setReplayToMessageId(Integer replayToMessageId) {
this.replayToMessageId = replayToMessageId;
return this;
}
public ReplyKeyboard getReplayMarkup() {
return replayMarkup;
}
public void setReplayMarkup(ReplyKeyboard replayMarkup) {
public SendPhoto setReplayMarkup(ReplyKeyboard replayMarkup) {
this.replayMarkup = replayMarkup;
return this;
}
public boolean isNewPhoto() {
@ -97,10 +102,11 @@ public class SendPhoto {
this.disableNotification = true;
}
public void setNewPhoto(String photo, String photoName) {
public SendPhoto setNewPhoto(String photo, String photoName) {
this.photo = photo;
this.isNewPhoto = true;
this.photoName = photoName;
return this;
}
@Override

View File

@ -37,39 +37,44 @@ public class SendSticker {
return chatId;
}
public void setChatId(String chatId) {
public SendSticker setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public String getSticker() {
return sticker;
}
public void setSticker(String sticker) {
public SendSticker setSticker(String sticker) {
this.sticker = sticker;
this.isNewSticker = false;
return this;
}
public Integer getReplayToMessageId() {
return replayToMessageId;
}
public void setReplayToMessageId(Integer replayToMessageId) {
public SendSticker setReplayToMessageId(Integer replayToMessageId) {
this.replayToMessageId = replayToMessageId;
return this;
}
public ReplyKeyboard getReplayMarkup() {
return replayMarkup;
}
public void setReplayMarkup(ReplyKeyboard replayMarkup) {
public SendSticker setReplayMarkup(ReplyKeyboard replayMarkup) {
this.replayMarkup = replayMarkup;
return this;
}
public void setSticker(String sticker, String stickerName) {
public SendSticker setSticker(String sticker, String stickerName) {
this.sticker = sticker;
this.isNewSticker = true;
this.stickerName = stickerName;
return this;
}
public Boolean getDisableNotification() {

View File

@ -49,40 +49,45 @@ public class SendVenue extends BotApiMethod<Message> {
return chatId;
}
public void setChatId(String chatId) {
public SendVenue setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public Float getLatitude() {
return latitude;
}
public void setLatitude(Float latitude) {
public SendVenue setLatitude(Float latitude) {
this.latitude = latitude;
return this;
}
public Float getLongitude() {
return longitude;
}
public void setLongitude(Float longitude) {
public SendVenue setLongitude(Float longitude) {
this.longitude = longitude;
return this;
}
public Integer getReplayToMessageId() {
return replayToMessageId;
}
public void setReplayToMessageId(Integer replayToMessageId) {
public SendVenue setReplayToMessageId(Integer replayToMessageId) {
this.replayToMessageId = replayToMessageId;
return this;
}
public ReplyKeyboard getReplayMarkup() {
return replayMarkup;
}
public void setReplayMarkup(ReplyKeyboard replayMarkup) {
public SendVenue setReplayMarkup(ReplyKeyboard replayMarkup) {
this.replayMarkup = replayMarkup;
return this;
}
public Boolean getDisableNotification() {
@ -101,24 +106,27 @@ public class SendVenue extends BotApiMethod<Message> {
return title;
}
public void setTitle(String title) {
public SendVenue setTitle(String title) {
this.title = title;
return this;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
public SendVenue setAddress(String address) {
this.address = address;
return this;
}
public String getFoursquareId() {
return foursquareId;
}
public void setFoursquareId(String foursquareId) {
public SendVenue setFoursquareId(String foursquareId) {
this.foursquareId = foursquareId;
return this;
}
@Override

View File

@ -46,49 +46,55 @@ public class SendVideo {
return chatId;
}
public void setChatId(String chatId) {
public SendVideo setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public String getVideo() {
return video;
}
public void setVideo(String video) {
public SendVideo setVideo(String video) {
this.video = video;
this.isNewVideo = false;
return this;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
public SendVideo setDuration(Integer duration) {
this.duration = duration;
return this;
}
public String getCaption() {
return caption;
}
public void setCaption(String caption) {
public SendVideo setCaption(String caption) {
this.caption = caption;
return this;
}
public Integer getReplayToMessageId() {
return replayToMessageId;
}
public void setReplayToMessageId(Integer replayToMessageId) {
public SendVideo setReplayToMessageId(Integer replayToMessageId) {
this.replayToMessageId = replayToMessageId;
return this;
}
public ReplyKeyboard getReplayMarkup() {
return replayMarkup;
}
public void setReplayMarkup(ReplyKeyboard replayMarkup) {
public SendVideo setReplayMarkup(ReplyKeyboard replayMarkup) {
this.replayMarkup = replayMarkup;
return this;
}
public boolean isNewVideo() {
@ -115,22 +121,25 @@ public class SendVideo {
return width;
}
public void setWidth(Integer width) {
public SendVideo setWidth(Integer width) {
this.width = width;
return this;
}
public Integer getHeight() {
return height;
}
public void setHeight(Integer height) {
public SendVideo setHeight(Integer height) {
this.height = height;
return this;
}
public void setNewVideo(String video, String videoName) {
public SendVideo setNewVideo(String video, String videoName) {
this.video = video;
this.isNewVideo = true;
this.videoName = videoName;
return this;
}
@Override

View File

@ -64,47 +64,53 @@ public class SendVoice {
return chatId;
}
public void setChatId(String chatId) {
public SendVoice setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public String getAudio() {
return audio;
}
public void setAudio(String audio) {
public SendVoice setAudio(String audio) {
this.audio = audio;
this.isNewVoice = false;
return this;
}
public void setNewAudio(String audio, String audioName) {
public SendVoice setNewAudio(String audio, String audioName) {
this.audio = audio;
this.isNewVoice = false;
this.voiceName = audioName;
return this;
}
public Integer getReplayToMessageId() {
return replayToMessageId;
}
public void setReplayToMessageId(Integer replayToMessageId) {
public SendVoice setReplayToMessageId(Integer replayToMessageId) {
this.replayToMessageId = replayToMessageId;
return this;
}
public ReplyKeyboard getReplayMarkup() {
return replayMarkup;
}
public void setReplayMarkup(ReplyKeyboard replayMarkup) {
public SendVoice setReplayMarkup(ReplyKeyboard replayMarkup) {
this.replayMarkup = replayMarkup;
return this;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
public SendVoice setDuration(Integer duration) {
this.duration = duration;
return this;
}
public boolean isNewVoice() {

View File

@ -43,24 +43,27 @@ public class GetUpdates implements IToJson {
return offset;
}
public void setOffset(Integer offset) {
public GetUpdates setOffset(Integer offset) {
this.offset = offset;
return this;
}
public Integer getLimit() {
return limit;
}
public void setLimit(Integer limit) {
public GetUpdates setLimit(Integer limit) {
this.limit = limit;
return this;
}
public Integer getTimeout() {
return timeout;
}
public void setTimeout(Integer timeout) {
public GetUpdates setTimeout(Integer timeout) {
this.timeout = timeout;
return this;
}
@Override

View File

@ -25,16 +25,18 @@ public class SetWebhook {
return url;
}
public void setUrl(String url) {
public SetWebhook setUrl(String url) {
this.url = url;
return this;
}
public String getCertificateFile() {
return certificateFile;
}
public void setCertificateFile(String certificateFile) {
public SetWebhook setCertificateFile(String certificateFile) {
this.certificateFile = certificateFile;
return this;
}
@Override

View File

@ -52,40 +52,45 @@ public class EditMessageCaption extends BotApiMethod<Message> {
return chatId;
}
public void setChatId(String chatId) {
public EditMessageCaption setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public Integer getMessageId() {
return messageId;
}
public void setMessageId(Integer messageId) {
public EditMessageCaption setMessageId(Integer messageId) {
this.messageId = messageId;
return this;
}
public String getInlineMessageId() {
return inlineMessageId;
}
public void setInlineMessageId(String inlineMessageId) {
public EditMessageCaption setInlineMessageId(String inlineMessageId) {
this.inlineMessageId = inlineMessageId;
return this;
}
public String getCaption() {
return caption;
}
public void setCaption(String caption) {
public EditMessageCaption setCaption(String caption) {
this.caption = caption;
return this;
}
public InlineKeyboardMarkup getReplyMarkup() {
return replyMarkup;
}
public void setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
public EditMessageCaption setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
this.replyMarkup = replyMarkup;
return this;
}
@Override

View File

@ -50,32 +50,36 @@ public class EditMessageReplyMarkup extends BotApiMethod<Message> {
return chatId;
}
public void setChatId(String chatId) {
public EditMessageReplyMarkup setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public Integer getMessageId() {
return messageId;
}
public void setMessageId(Integer messageId) {
public EditMessageReplyMarkup setMessageId(Integer messageId) {
this.messageId = messageId;
return this;
}
public String getInlineMessageId() {
return inlineMessageId;
}
public void setInlineMessageId(String inlineMessageId) {
public EditMessageReplyMarkup setInlineMessageId(String inlineMessageId) {
this.inlineMessageId = inlineMessageId;
return this;
}
public InlineKeyboardMarkup getReplyMarkup() {
return replyMarkup;
}
public void setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
public EditMessageReplyMarkup setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
this.replyMarkup = replyMarkup;
return this;
}
@Override

View File

@ -64,40 +64,45 @@ public class EditMessageText extends BotApiMethod<Message> {
return chatId;
}
public void setChatId(String chatId) {
public EditMessageText setChatId(String chatId) {
this.chatId = chatId;
return this;
}
public Integer getMessageId() {
return messageId;
}
public void setMessageId(Integer messageId) {
public EditMessageText setMessageId(Integer messageId) {
this.messageId = messageId;
return this;
}
public String getInlineMessageId() {
return inlineMessageId;
}
public void setInlineMessageId(String inlineMessageId) {
public EditMessageText setInlineMessageId(String inlineMessageId) {
this.inlineMessageId = inlineMessageId;
return this;
}
public String getText() {
return text;
}
public void setText(String text) {
public EditMessageText setText(String text) {
this.text = text;
return this;
}
public InlineKeyboardMarkup getReplyMarkup() {
return replyMarkup;
}
public void setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
public EditMessageText setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
this.replyMarkup = replyMarkup;
return this;
}
public void disableWebPagePreview() {