NotificationState.java 956 Bytes
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.cq.mobile.notifications.impl;

import java.util.Locale;

public enum NotificationState {
    ERROR("error"),
    DRAFT("draft"),
    READY("ready"),
    SCHEDULED("scheduled"),
    SENT("sent");
    
    private String state;

    private NotificationState() {
    }

    private NotificationState(String state) {
        this.state = state;
    }

    public String asString() {
        return this.state;
    }

    public String toString() {
        return this.asString();
    }

    public static boolean isA(String value) {
        try {
            return NotificationState.getFromString(value) != null;
        }
        catch (IllegalArgumentException ex) {
            return false;
        }
    }

    public static NotificationState getFromString(String value) throws IllegalArgumentException {
        return NotificationState.valueOf(value.trim().toUpperCase(Locale.ENGLISH));
    }
}