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

com.urbanairship.api.channel.model.email.OptInMode Maven / Gradle / Ivy

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

import java.util.Optional;

/**
 * Enum of opt in modes
 */
public enum OptInMode {

    CLASSIC("classic"),
    DOUBLE("double");

    private final String identifier;

    private OptInMode() {
        this(null);
    }

    private OptInMode(String identifier) {
        this.identifier = identifier;
    }

    public static Optional find(String identifier) {
        for (OptInMode optInLevel : values()) {
            if (optInLevel.getIdentifier().equals(identifier)) {
                return Optional.of(optInLevel);
            }
        }

        return Optional.empty();
    }

    public String getIdentifier() {
        return identifier;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy