ProtectionContext.java 680 Bytes
/*
 * Decompiled with CFR 0_118.
 */
package com.day.cq.xss;

public enum ProtectionContext {
    HTML_HTML_CONTENT("htmlToHtmlContent"),
    PLAIN_HTML_CONTENT("plainToHtmlContent");
    
    private String name;

    private ProtectionContext(String name) {
        this.name = name;
    }

    public String getName() {
        return this.name;
    }

    public static ProtectionContext fromName(String name) {
        ProtectionContext[] values;
        for (ProtectionContext contextToCheck : values = ProtectionContext.values()) {
            if (!contextToCheck.getName().equals(name)) continue;
            return contextToCheck;
        }
        return null;
    }
}