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;
|
return disableNotification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableNotification() {
|
public SendAudio enableNotification() {
|
||||||
this.disableNotification = false;
|
this.disableNotification = false;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableNotification() {
|
public SendAudio disableNotification() {
|
||||||
this.disableNotification = true;
|
this.disableNotification = true;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNewAudio() {
|
public boolean isNewAudio() {
|
||||||
|
@ -72,12 +72,14 @@ public class SendContact extends BotApiMethod<Message> {
|
|||||||
return disableNotification;
|
return disableNotification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableNotification() {
|
public SendContact enableNotification() {
|
||||||
this.disableNotification = false;
|
this.disableNotification = false;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableNotification() {
|
public SendContact disableNotification() {
|
||||||
this.disableNotification = true;
|
this.disableNotification = true;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPhoneNumber() {
|
public String getPhoneNumber() {
|
||||||
|
@ -82,12 +82,14 @@ public class SendDocument {
|
|||||||
return disableNotification;
|
return disableNotification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableNotification() {
|
public SendDocument enableNotification() {
|
||||||
this.disableNotification = false;
|
this.disableNotification = false;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableNotification() {
|
public SendDocument disableNotification() {
|
||||||
this.disableNotification = true;
|
this.disableNotification = true;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCaption() {
|
public String getCaption() {
|
||||||
|
@ -87,12 +87,14 @@ public class SendLocation extends BotApiMethod<Message> {
|
|||||||
return disableNotification;
|
return disableNotification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableNotification() {
|
public SendLocation enableNotification() {
|
||||||
this.disableNotification = false;
|
this.disableNotification = false;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableNotification() {
|
public SendLocation disableNotification() {
|
||||||
this.disableNotification = true;
|
this.disableNotification = true;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -89,36 +89,42 @@ public class SendMessage extends BotApiMethod<Message> {
|
|||||||
return disableNotification;
|
return disableNotification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableWebPagePreview() {
|
public SendMessage disableWebPagePreview() {
|
||||||
disableWebPagePreview = true;
|
disableWebPagePreview = true;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableWebPagePreview() {
|
public SendMessage enableWebPagePreview() {
|
||||||
disableWebPagePreview = null;
|
disableWebPagePreview = null;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableNotification() {
|
public SendMessage enableNotification() {
|
||||||
this.disableNotification = null;
|
this.disableNotification = null;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableNotification() {
|
public SendMessage disableNotification() {
|
||||||
this.disableNotification = true;
|
this.disableNotification = true;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableMarkdown(boolean enable) {
|
public SendMessage enableMarkdown(boolean enable) {
|
||||||
if (enable) {
|
if (enable) {
|
||||||
this.parseMode = ParseMode.MARKDOWN;
|
this.parseMode = ParseMode.MARKDOWN;
|
||||||
} else {
|
} else {
|
||||||
this.parseMode = null;
|
this.parseMode = null;
|
||||||
}
|
}
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableHtml(boolean enable) {
|
public SendMessage enableHtml(boolean enable) {
|
||||||
if (enable) {
|
if (enable) {
|
||||||
this.parseMode = ParseMode.HTML;
|
this.parseMode = ParseMode.HTML;
|
||||||
} else {
|
} else {
|
||||||
this.parseMode = null;
|
this.parseMode = null;
|
||||||
}
|
}
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -94,12 +94,14 @@ public class SendPhoto {
|
|||||||
return disableNotification;
|
return disableNotification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableNotification() {
|
public SendPhoto enableNotification() {
|
||||||
this.disableNotification = false;
|
this.disableNotification = false;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableNotification() {
|
public SendPhoto disableNotification() {
|
||||||
this.disableNotification = true;
|
this.disableNotification = true;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SendPhoto setNewPhoto(String photo, String photoName) {
|
public SendPhoto setNewPhoto(String photo, String photoName) {
|
||||||
|
@ -81,12 +81,14 @@ public class SendSticker {
|
|||||||
return disableNotification;
|
return disableNotification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableNotification() {
|
public SendSticker enableNotification() {
|
||||||
this.disableNotification = false;
|
this.disableNotification = false;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableNotification() {
|
public SendSticker disableNotification() {
|
||||||
this.disableNotification = true;
|
this.disableNotification = true;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNewSticker() {
|
public boolean isNewSticker() {
|
||||||
|
@ -94,12 +94,14 @@ public class SendVenue extends BotApiMethod<Message> {
|
|||||||
return disableNotification;
|
return disableNotification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableNotification() {
|
public SendVenue enableNotification() {
|
||||||
this.disableNotification = false;
|
this.disableNotification = false;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableNotification() {
|
public SendVenue disableNotification() {
|
||||||
this.disableNotification = true;
|
this.disableNotification = true;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
|
@ -109,12 +109,14 @@ public class SendVideo {
|
|||||||
return disableNotification;
|
return disableNotification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableNotification() {
|
public SendVideo enableNotification() {
|
||||||
this.disableNotification = false;
|
this.disableNotification = false;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableNotification() {
|
public SendVideo disableNotification() {
|
||||||
this.disableNotification = true;
|
this.disableNotification = true;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getWidth() {
|
public Integer getWidth() {
|
||||||
|
@ -52,12 +52,14 @@ public class SendVoice {
|
|||||||
return disableNotification;
|
return disableNotification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableNotification() {
|
public SendVoice enableNotification() {
|
||||||
this.disableNotification = false;
|
this.disableNotification = false;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableNotification() {
|
public SendVoice disableNotification() {
|
||||||
this.disableNotification = true;
|
this.disableNotification = true;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getChatId() {
|
public String getChatId() {
|
||||||
|
@ -105,28 +105,32 @@ public class EditMessageText extends BotApiMethod<Message> {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableWebPagePreview() {
|
public EditMessageText disableWebPagePreview() {
|
||||||
disableWebPagePreview = true;
|
disableWebPagePreview = true;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableWebPagePreview() {
|
public EditMessageText enableWebPagePreview() {
|
||||||
disableWebPagePreview = null;
|
disableWebPagePreview = null;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableMarkdown(boolean enable) {
|
public EditMessageText enableMarkdown(boolean enable) {
|
||||||
if (enable) {
|
if (enable) {
|
||||||
this.parseMode = ParseMode.MARKDOWN;
|
this.parseMode = ParseMode.MARKDOWN;
|
||||||
} else {
|
} else {
|
||||||
this.parseMode = null;
|
this.parseMode = null;
|
||||||
}
|
}
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableHtml(boolean enable) {
|
public EditMessageText enableHtml(boolean enable) {
|
||||||
if (enable) {
|
if (enable) {
|
||||||
this.parseMode = ParseMode.HTML;
|
this.parseMode = ParseMode.HTML;
|
||||||
} else {
|
} else {
|
||||||
this.parseMode = null;
|
this.parseMode = null;
|
||||||
}
|
}
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user