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

com.urbanairship.api.createandsend.model.audience.CreateAndSendAudience Maven / Gradle / Ivy

There is a newer version: 9.4.2
Show newest version
package com.urbanairship.api.createandsend.model.audience;

import com.urbanairship.api.createandsend.model.audience.email.EmailChannels;
import com.urbanairship.api.createandsend.model.audience.sms.SmsChannels;
import com.urbanairship.api.push.model.PushModelObject;

import java.util.Objects;
import java.util.Optional;

public class CreateAndSendAudience extends PushModelObject {
    private Optional emailChannels = Optional.empty();
    private Optional smsChannels = Optional.empty();

    /**
     * Create and send audience for EmailChannels
     * @param emailChannels EmailChannels
     */
    public CreateAndSendAudience(EmailChannels emailChannels) {
        this.emailChannels = Optional.ofNullable(emailChannels);
    }

    /**
     * Create and send audience for SmsChannels
     * @param smsChannels SmsChannels
     */
    public CreateAndSendAudience(SmsChannels smsChannels) {
        this.smsChannels = Optional.ofNullable(smsChannels);
    }

    /**
     * Get the audience email channels if present.
     * @return Optional EmailChannels
     */
    public Optional getEmailChannels() {
        return emailChannels;
    }

    /**
     * Get the audience sms channels if present.
     * @return Optional SmsChannels
     */
    public Optional getSmsChannels() {
        return smsChannels;
    }

    @Override
    public String toString() {
        return "CreateAndSendAudience{" +
                "emailChannels=" + emailChannels +
                ", smsChannels=" + smsChannels +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof CreateAndSendAudience)) return false;
        CreateAndSendAudience that = (CreateAndSendAudience) o;
        return Objects.equals(getEmailChannels(), that.getEmailChannels()) &&
                Objects.equals(getSmsChannels(), that.getSmsChannels());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getEmailChannels(), getSmsChannels());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy