Java Dictionary Usage getString(Dictionary p, Object key, String defaultValue)

Here you can find the source of getString(Dictionary p, Object key, String defaultValue)

Description

get String

License

Open Source License

Declaration

public static String getString(Dictionary p, Object key, String defaultValue) 

Method Source Code

//package com.java2s;
/*//from   w  w  w  .java2  s.  c o  m
 * Copyright 2012 The Solmix Project
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.gnu.org/licenses/ 
 * or see the FSF site: http://www.fsf.org. 
 */

import java.util.Dictionary;

public class Main {
    public static String getString(Dictionary p, Object key, String defaultValue) {
        Object value = p.get(key);
        if (value == null)
            return defaultValue;
        else
            return value.toString();
    }
}

Related

  1. addReferenceIdsToServiceProperties(String prefix, Map referenceProps, Dictionary serviceProps)
  2. containsKey(Dictionary dict, String key)
  3. getBoolean(Dictionary p, Object key, Boolean defaultValue)
  4. getSpringContextHeader(Dictionary headers)
  5. getState(Dictionary conf, String property)
  6. isNullOrNothing(final Object[] array)
  7. parseRequestOption(Dictionary conf, String confParam, Map requestOptions)
  8. setDefault(Dictionary dict, String key, String value)
  9. setProperty(Dictionary properties, String key, String value)