methods classes: enable/dissable methods to builder style
This commit is contained in:
parent
79616210f4
commit
1232d6f378
@ -130,12 +130,14 @@ public class SendAudio {
|
||||
return disableNotification;
|
||||
}
|
||||
|
||||
public void enableNotification() {
|
||||
public SendAudio enableNotification() {
|
||||
this.disableNotification = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void disableNotification() {
|
||||
public SendAudio disableNotification() {
|
||||
this.disableNotification = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isNewAudio() {
|
||||
|
@ -72,12 +72,14 @@ public class SendContact extends BotApiMethod<Message> {
|
||||
return disableNotification;
|
||||
}
|
||||
|
||||
public void enableNotification() {
|
||||
public SendContact enableNotification() {
|
||||
this.disableNotification = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void disableNotification() {
|
||||
public SendContact disableNotification() {
|
||||
this.disableNotification = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPhoneNumber() {
|
||||
|
@ -82,12 +82,14 @@ public class SendDocument {
|
||||
return disableNotification;
|
||||
}
|
||||
|
||||
public void enableNotification() {
|
||||
public SendDocument enableNotification() {
|
||||
this.disableNotification = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void disableNotification() {
|
||||
public SendDocument disableNotification() {
|
||||
this.disableNotification = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCaption() {
|
||||
|
@ -87,12 +87,14 @@ public class SendLocation extends BotApiMethod<Message> {
|
||||
return disableNotification;
|
||||
}
|
||||
|
||||
public void enableNotification() {
|
||||
public SendLocation enableNotification() {
|
||||
this.disableNotification = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void disableNotification() {
|
||||
public SendLocation disableNotification() {
|
||||
this.disableNotification = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -89,36 +89,42 @@ public class SendMessage extends BotApiMethod<Message> {
|
||||
return disableNotification;
|
||||
}
|
||||
|
||||
public void disableWebPagePreview() {
|
||||
public SendMessage disableWebPagePreview() {
|
||||
disableWebPagePreview = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void enableWebPagePreview() {
|
||||
public SendMessage enableWebPagePreview() {
|
||||
disableWebPagePreview = null;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void enableNotification() {
|
||||
public SendMessage enableNotification() {
|
||||
this.disableNotification = null;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void disableNotification() {
|
||||
public SendMessage disableNotification() {
|
||||
this.disableNotification = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void enableMarkdown(boolean enable) {
|
||||
public SendMessage enableMarkdown(boolean enable) {
|
||||
if (enable) {
|
||||
this.parseMode = ParseMode.MARKDOWN;
|
||||
} else {
|
||||
this.parseMode = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public void enableHtml(boolean enable) {
|
||||
public SendMessage enableHtml(boolean enable) {
|
||||
if (enable) {
|
||||
this.parseMode = ParseMode.HTML;
|
||||
} else {
|
||||
this.parseMode = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -94,12 +94,14 @@ public class SendPhoto {
|
||||
return disableNotification;
|
||||
}
|
||||
|
||||
public void enableNotification() {
|
||||
public SendPhoto enableNotification() {
|
||||
this.disableNotification = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void disableNotification() {
|
||||
public SendPhoto disableNotification() {
|
||||
this.disableNotification = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SendPhoto setNewPhoto(String photo, String photoName) {
|
||||
|
@ -81,12 +81,14 @@ public class SendSticker {
|
||||
return disableNotification;
|
||||
}
|
||||
|
||||
public void enableNotification() {
|
||||
public SendSticker enableNotification() {
|
||||
this.disableNotification = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void disableNotification() {
|
||||
public SendSticker disableNotification() {
|
||||
this.disableNotification = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isNewSticker() {
|
||||
|
@ -94,12 +94,14 @@ public class SendVenue extends BotApiMethod<Message> {
|
||||
return disableNotification;
|
||||
}
|
||||
|
||||
public void enableNotification() {
|
||||
public SendVenue enableNotification() {
|
||||
this.disableNotification = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void disableNotification() {
|
||||
public SendVenue disableNotification() {
|
||||
this.disableNotification = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
|
@ -109,12 +109,14 @@ public class SendVideo {
|
||||
return disableNotification;
|
||||
}
|
||||
|
||||
public void enableNotification() {
|
||||
public SendVideo enableNotification() {
|
||||
this.disableNotification = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void disableNotification() {
|
||||
public SendVideo disableNotification() {
|
||||
this.disableNotification = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getWidth() {
|
||||
|
@ -52,12 +52,14 @@ public class SendVoice {
|
||||
return disableNotification;
|
||||
}
|
||||
|
||||
public void enableNotification() {
|
||||
public SendVoice enableNotification() {
|
||||
this.disableNotification = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void disableNotification() {
|
||||
public SendVoice disableNotification() {
|
||||
this.disableNotification = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getChatId() {
|
||||
|
@ -105,28 +105,32 @@ public class EditMessageText extends BotApiMethod<Message> {
|
||||
return this;
|
||||
}
|
||||
|
||||
public void disableWebPagePreview() {
|
||||
public EditMessageText disableWebPagePreview() {
|
||||
disableWebPagePreview = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void enableWebPagePreview() {
|
||||
public EditMessageText enableWebPagePreview() {
|
||||
disableWebPagePreview = null;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void enableMarkdown(boolean enable) {
|
||||
public EditMessageText enableMarkdown(boolean enable) {
|
||||
if (enable) {
|
||||
this.parseMode = ParseMode.MARKDOWN;
|
||||
} else {
|
||||
this.parseMode = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public void enableHtml(boolean enable) {
|
||||
public EditMessageText enableHtml(boolean enable) {
|
||||
if (enable) {
|
||||
this.parseMode = ParseMode.HTML;
|
||||
} else {
|
||||
this.parseMode = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user