RequestUtils.java 959 Bytes
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  org.apache.sling.api.SlingHttpServletRequest
 */
package com.adobe.cq.mobile.dps.impl.utils;

import org.apache.sling.api.SlingHttpServletRequest;

public abstract class RequestUtils {
    public static boolean getParameter(SlingHttpServletRequest request, String paramKey, boolean defaultValue) {
        boolean booleanValue = defaultValue;
        String paramValue = request.getParameter(paramKey);
        if (paramValue != null) {
            booleanValue = Boolean.parseBoolean(paramValue);
        }
        return booleanValue;
    }

    public static String getParameter(SlingHttpServletRequest request, String paramKey, String defaultValue) {
        String stringValue = defaultValue;
        String paramValue = request.getParameter(paramKey);
        if (paramValue != null) {
            stringValue = paramValue;
        }
        return stringValue;
    }
}