001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.wicket.request.parameter;
018
019import java.util.Collections;
020import java.util.List;
021import java.util.Set;
022
023import org.apache.wicket.request.IRequestParameters;
024import org.apache.wicket.util.string.StringValue;
025
026/**
027 * Read only empty {@link IRequestParameters}.
028 * 
029 * @author Matej Knopp
030 */
031public class EmptyRequestParameters implements IRequestParameters
032{
033        /** Singleton instance. */
034        public static final EmptyRequestParameters INSTANCE = new EmptyRequestParameters();
035
036        /**
037         * Construct.
038         */
039        private EmptyRequestParameters()
040        {
041        }
042
043        /**
044         * @see org.apache.wicket.request.IRequestParameters#getParameterNames()
045         */
046        @Override
047        public Set<String> getParameterNames()
048        {
049                return Collections.emptySet();
050        }
051
052        /**
053         * @see org.apache.wicket.request.IRequestParameters#getParameterValue(java.lang.String)
054         */
055        @Override
056        public StringValue getParameterValue(final String name)
057        {
058                return StringValue.valueOf((String)null);
059        }
060
061        /**
062         * @see org.apache.wicket.request.IRequestParameters#getParameterValues(java.lang.String)
063         */
064        @Override
065        public List<StringValue> getParameterValues(final String name)
066        {
067                return null;
068        }
069}