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

io.higgs.http.server.params.QueryParams Maven / Gradle / Ivy

There is a newer version: 0.0.24
Show newest version
package io.higgs.http.server.params;

import java.util.HashMap;
import java.util.List;

/**
 * Represents the set of query string parameters available with a request
 *
 * @author Courtney Robinson 
 */
public class QueryParams extends HashMap> {
    /**
     * Gets the first value of the query string parameter with the given name
     *
     * @param name the name of the query string parameter to get
     * @return the value of the parameter or null if it doesn't exist
     */
    public String getFirst(String name) {
        List vals = get(name);
        if (vals == null) {
            return null;
        }
        return vals.get(0);
    }

    public int getSize() {
        return size();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy