All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.auties.whatsapp.model.message.server.ProtocolMessageBuilder Maven / Gradle / Ivy

package it.auties.whatsapp.model.message.server;

public class ProtocolMessageBuilder {
    private java.util.Optional key;
    private it.auties.whatsapp.model.message.server.ProtocolMessage.Type protocolType;
    private long ephemeralExpiration;
    private long ephemeralSettingTimestampSeconds;
    private java.util.Optional historySyncNotification;
    private java.util.Optional appStateSyncKeyShare;
    private java.util.Optional appStateSyncKeyRequest;
    private java.util.Optional initialSecurityNotificationSettingSync;
    private java.util.Optional appStateFatalExceptionNotification;
    private java.util.Optional disappearingMode;
    private java.util.Optional editedMessage;
    private long timestampMilliseconds;

    public ProtocolMessageBuilder() {
        key = java.util.Optional.empty();
        protocolType = null;
        ephemeralExpiration = 0l;
        ephemeralSettingTimestampSeconds = 0l;
        historySyncNotification = java.util.Optional.empty();
        appStateSyncKeyShare = java.util.Optional.empty();
        appStateSyncKeyRequest = java.util.Optional.empty();
        initialSecurityNotificationSettingSync = java.util.Optional.empty();
        appStateFatalExceptionNotification = java.util.Optional.empty();
        disappearingMode = java.util.Optional.empty();
        editedMessage = java.util.Optional.empty();
        timestampMilliseconds = 0l;
    }

    public ProtocolMessageBuilder key(java.util.Optional key) {
        this.key = key;
        return this;
    }
    public ProtocolMessageBuilder key(it.auties.whatsapp.model.message.model.ChatMessageKey key) {
        this.key = java.util.Optional.ofNullable(key);
        return this;
    }
    public ProtocolMessageBuilder protocolType(it.auties.whatsapp.model.message.server.ProtocolMessage.Type protocolType) {
        this.protocolType = protocolType;
        return this;
    }
    public ProtocolMessageBuilder ephemeralExpiration(long ephemeralExpiration) {
        this.ephemeralExpiration = ephemeralExpiration;
        return this;
    }
    public ProtocolMessageBuilder ephemeralSettingTimestampSeconds(long ephemeralSettingTimestampSeconds) {
        this.ephemeralSettingTimestampSeconds = ephemeralSettingTimestampSeconds;
        return this;
    }
    public ProtocolMessageBuilder historySyncNotification(java.util.Optional historySyncNotification) {
        this.historySyncNotification = historySyncNotification;
        return this;
    }
    public ProtocolMessageBuilder historySyncNotification(it.auties.whatsapp.model.sync.HistorySyncNotification historySyncNotification) {
        this.historySyncNotification = java.util.Optional.ofNullable(historySyncNotification);
        return this;
    }
    public ProtocolMessageBuilder appStateSyncKeyShare(java.util.Optional appStateSyncKeyShare) {
        this.appStateSyncKeyShare = appStateSyncKeyShare;
        return this;
    }
    public ProtocolMessageBuilder appStateSyncKeyShare(it.auties.whatsapp.model.sync.AppStateSyncKeyShare appStateSyncKeyShare) {
        this.appStateSyncKeyShare = java.util.Optional.ofNullable(appStateSyncKeyShare);
        return this;
    }
    public ProtocolMessageBuilder appStateSyncKeyRequest(java.util.Optional appStateSyncKeyRequest) {
        this.appStateSyncKeyRequest = appStateSyncKeyRequest;
        return this;
    }
    public ProtocolMessageBuilder appStateSyncKeyRequest(it.auties.whatsapp.model.sync.AppStateSyncKeyRequest appStateSyncKeyRequest) {
        this.appStateSyncKeyRequest = java.util.Optional.ofNullable(appStateSyncKeyRequest);
        return this;
    }
    public ProtocolMessageBuilder initialSecurityNotificationSettingSync(java.util.Optional initialSecurityNotificationSettingSync) {
        this.initialSecurityNotificationSettingSync = initialSecurityNotificationSettingSync;
        return this;
    }
    public ProtocolMessageBuilder initialSecurityNotificationSettingSync(it.auties.whatsapp.model.sync.InitialSecurityNotificationSettingSync initialSecurityNotificationSettingSync) {
        this.initialSecurityNotificationSettingSync = java.util.Optional.ofNullable(initialSecurityNotificationSettingSync);
        return this;
    }
    public ProtocolMessageBuilder appStateFatalExceptionNotification(java.util.Optional appStateFatalExceptionNotification) {
        this.appStateFatalExceptionNotification = appStateFatalExceptionNotification;
        return this;
    }
    public ProtocolMessageBuilder appStateFatalExceptionNotification(it.auties.whatsapp.model.sync.AppStateFatalExceptionNotification appStateFatalExceptionNotification) {
        this.appStateFatalExceptionNotification = java.util.Optional.ofNullable(appStateFatalExceptionNotification);
        return this;
    }
    public ProtocolMessageBuilder disappearingMode(java.util.Optional disappearingMode) {
        this.disappearingMode = disappearingMode;
        return this;
    }
    public ProtocolMessageBuilder disappearingMode(it.auties.whatsapp.model.chat.ChatDisappear disappearingMode) {
        this.disappearingMode = java.util.Optional.ofNullable(disappearingMode);
        return this;
    }
    public ProtocolMessageBuilder editedMessage(java.util.Optional editedMessage) {
        this.editedMessage = editedMessage;
        return this;
    }
    public ProtocolMessageBuilder editedMessage(it.auties.whatsapp.model.message.model.MessageContainer editedMessage) {
        this.editedMessage = java.util.Optional.ofNullable(editedMessage);
        return this;
    }
    public ProtocolMessageBuilder timestampMilliseconds(long timestampMilliseconds) {
        this.timestampMilliseconds = timestampMilliseconds;
        return this;
    }

    public it.auties.whatsapp.model.message.server.ProtocolMessage build() {
        return new it.auties.whatsapp.model.message.server.ProtocolMessage(key, protocolType, ephemeralExpiration, ephemeralSettingTimestampSeconds, historySyncNotification, appStateSyncKeyShare, appStateSyncKeyRequest, initialSecurityNotificationSettingSync, appStateFatalExceptionNotification, disappearingMode, editedMessage, timestampMilliseconds);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy