WCMResourceOptions.java 1.64 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  aQute.bnd.annotation.ProviderType
 *  com.day.cq.wcm.api.WCMMode
 *  org.apache.commons.lang3.StringUtils
 */
package com.adobe.cq.sightly;

import aQute.bnd.annotation.ProviderType;
import com.day.cq.wcm.api.WCMMode;
import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;

@ProviderType
public class WCMResourceOptions
extends HashMap<String, String> {
    public static final String OPTION_WCMMODE = "wcmmode";
    public static final String OPTION_DECORATION_TAG_NAME = "decorationTagName";
    public static final String OPTION_CSS_CLASS = "cssClassName";

    public WCMMode getWCMMode() {
        String mode = (String)this.get("wcmmode");
        if (StringUtils.isNotEmpty((CharSequence)mode)) {
            return WCMMode.valueOf((String)mode.toUpperCase());
        }
        return null;
    }

    public String getDecorationTagName() {
        return (String)this.get("decorationTagName");
    }

    public String getCssClassName() {
        return (String)this.get("cssClassName");
    }

    public void setOptionDecorationTagName(String decorationTagName) {
        this.put("decorationTagName", this.getInternalValue(decorationTagName));
    }

    public void setCssClassName(String cssClassName) {
        this.put("cssClassName", this.getInternalValue(cssClassName));
    }

    public void setWcmMode(String wcmMode) {
        this.put("wcmmode", this.getInternalValue(wcmMode));
    }

    private String getInternalValue(String value) {
        if (StringUtils.isEmpty((CharSequence)value)) {
            return "";
        }
        return value;
    }
}