it.auties.whatsapp.model.button.base.ButtonBuilder Maven / Gradle / Ivy
package it.auties.whatsapp.model.button.base;
public class ButtonBuilder {
private java.lang.String id;
private java.util.Optional bodyText;
private java.util.Optional bodyNativeFlow;
private it.auties.whatsapp.model.button.base.ButtonBody.Type bodyType;
public ButtonBuilder() {
id = null;
bodyText = java.util.Optional.empty();
bodyNativeFlow = java.util.Optional.empty();
bodyType = null;
}
public ButtonBuilder id(java.lang.String id) {
this.id = id;
return this;
}
public ButtonBuilder bodyText(java.util.Optional bodyText) {
this.bodyText = bodyText;
return this;
}
public ButtonBuilder bodyText(it.auties.whatsapp.model.button.base.ButtonText bodyText) {
this.bodyText = java.util.Optional.ofNullable(bodyText);
return this;
}
public ButtonBuilder bodyNativeFlow(java.util.Optional bodyNativeFlow) {
this.bodyNativeFlow = bodyNativeFlow;
return this;
}
public ButtonBuilder bodyNativeFlow(it.auties.whatsapp.model.info.NativeFlowInfo bodyNativeFlow) {
this.bodyNativeFlow = java.util.Optional.ofNullable(bodyNativeFlow);
return this;
}
public ButtonBuilder bodyType(it.auties.whatsapp.model.button.base.ButtonBody.Type bodyType) {
this.bodyType = bodyType;
return this;
}
public it.auties.whatsapp.model.button.base.Button build() {
return new it.auties.whatsapp.model.button.base.Button(id, bodyText, bodyNativeFlow, bodyType);
}
}