001package org.apache.turbine.util.uri;
002
003
004/*
005 * Licensed to the Apache Software Foundation (ASF) under one
006 * or more contributor license agreements.  See the NOTICE file
007 * distributed with this work for additional information
008 * regarding copyright ownership.  The ASF licenses this file
009 * to you under the Apache License, Version 2.0 (the
010 * "License"); you may not use this file except in compliance
011 * with the License.  You may obtain a copy of the License at
012 *
013 *   http://www.apache.org/licenses/LICENSE-2.0
014 *
015 * Unless required by applicable law or agreed to in writing,
016 * software distributed under the License is distributed on an
017 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
018 * KIND, either express or implied.  See the License for the
019 * specific language governing permissions and limitations
020 * under the License.
021 */
022
023
024import org.apache.commons.lang3.StringUtils;
025
026/**
027 * Helper Class to keep a key and a value together in
028 * one object. Used for URI Parameters
029 *
030 * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
031 * @version $Id: URIParam.java 1844792 2018-10-24 21:47:54Z painter $
032 */
033
034public class URIParam
035{
036    /** Key */
037    private String key = null;
038
039    /** Value */
040    private Object value = null;
041
042    /**
043     * Creates a new Object from Key and Value
044     *
045     * @param key A String with the Param Name.
046     * @param value An Object with the Value.
047     *
048     */
049    public URIParam(String key, Object value)
050    {
051        this.key = key;
052        this.value = value;
053    }
054
055    /**
056     * Returns the key.
057     *
058     * @return The key value.
059     *
060     */
061    public String getKey()
062    {
063        return (StringUtils.isNotEmpty(key)) ? key : "";
064    }
065
066    /**
067     * Returns the value.
068     *
069     * @return The value of this object.
070     *
071     */
072    public Object getValue()
073    {
074        return value;
075    }
076}