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

twitter4jads.models.ads.audience.TailoredAudienceUserDetails Maven / Gradle / Ivy

The newest version!
package twitter4jads.models.ads.audience;

import com.google.gson.annotations.SerializedName;

import java.util.Objects;
import java.util.Set;

/**
 * Twitter V4 Audience API user info
 * Denotes information for individual user
 * Add only hashed information
 * It is advisable to use TailoredAudienceUserDetailsBuilder
 *
 *
 * @date 25/11/18
 * @time 10:28 PM
 */
public class TailoredAudienceUserDetails {

    @SerializedName("email")
    private Set emails;

    @SerializedName("phone_number")
    private Set phoneNumbers;

    @SerializedName("device_id")    //IDFA/AdID/Android ID
    private Set deviceIds;

    @SerializedName("handle")
    private Set twitterHandles;

    @SerializedName("twitter_id")
    private Set twitterIds;

    public Set getEmails() {
        return emails;
    }

    public void setEmails(Set emails) {
        this.emails = emails;
    }

    public Set getPhoneNumbers() {
        return phoneNumbers;
    }

    public void setPhoneNumbers(Set phoneNumbers) {
        this.phoneNumbers = phoneNumbers;
    }

    public Set getDeviceIds() {
        return deviceIds;
    }

    public void setDeviceIds(Set deviceIds) {
        this.deviceIds = deviceIds;
    }

    public Set getTwitterHandles() {
        return twitterHandles;
    }

    public void setTwitterHandles(Set twitterHandles) {
        this.twitterHandles = twitterHandles;
    }

    public Set getTwitterIds() {
        return twitterIds;
    }

    public void setTwitterIds(Set twitterIds) {
        this.twitterIds = twitterIds;
    }

    public boolean isEmpty() {
        return !(!emails.isEmpty() || !twitterIds.isEmpty() || !twitterHandles.isEmpty() || !phoneNumbers.isEmpty() || !deviceIds.isEmpty());
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TailoredAudienceUserDetails that = (TailoredAudienceUserDetails) o;
        return Objects.equals(emails, that.emails) &&
                Objects.equals(phoneNumbers, that.phoneNumbers) &&
                Objects.equals(deviceIds, that.deviceIds) &&
                Objects.equals(twitterHandles, that.twitterHandles) &&
                Objects.equals(twitterIds, that.twitterIds);
    }

    @Override
    public int hashCode() {

        return Objects.hash(emails, phoneNumbers, deviceIds, twitterHandles, twitterIds);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy