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

it.auties.whatsapp.model.privacy.PrivacySettingValue Maven / Gradle / Ivy

There is a newer version: 2.7.2
Show newest version
package it.auties.whatsapp.model.privacy;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.experimental.Accessors;

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

/**
 * The constants of this enumerated type describe the various types of preferences that can be
 * toggled for a corresponding setting
 */
@AllArgsConstructor
@Accessors(fluent = true)
public enum PrivacySettingValue {
    /**
     * Everyone
     */
    EVERYONE("all"),
    /**
     * All the contacts saved on your Whatsapp's user
     */
    CONTACTS("contacts"),
    /**
     * All the contacts saved on your Whatsapp's user except some
     */
    CONTACTS_EXCEPT("contact_blacklist"),
    /**
     * Nobody
     */
    NOBODY("none"),
    /**
     * Match last seen
     */
    MATCH_LAST_SEEN("match_last_seen");

    @Getter
    private final String data;

    public static Optional of(String id) {
        return Arrays.stream(values()).filter(entry -> Objects.equals(entry.data(), id)).findFirst();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy