it.auties.whatsapp.model.privacy.PrivacySettingValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of whatsappweb4j Show documentation
Show all versions of whatsappweb4j Show documentation
Standalone fully-featured Whatsapp Web API for Java and Kotlin
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();
}
}