Converts a dictionary of String/String to a map.

@param dictionary to be converted

@return dictionary content as map

@throws IllegalArgumentException if dictionary entries keys or values are not string
439629
private static Map<String, String> dictionaryToMap( final Dictionary dictionary )
    {
        final Map<String, String> map = new HashMap<String, String>();
        try
        {
            // first try a shortcut
            if( dictionary instanceof Hashtable )
            {
                map.putAll( (Hashtable<String, String>) dictionary );
            }
            else
            {
                final Enumeration keys = dictionary.keys();
                while( keys.hasMoreElements() )
                {
                    final String key = (String) keys.nextElement();
                    map.put( key, (String) dictionary.get( key ) );
                }
            }
            return map;
        }
        catch( ClassCastException e )
        {
            throw new IllegalArgumentException( "Dictionary entries must have String keys and values" );
        }
    }
328808
public static byte[] encodeBZ(String data, String dictionary) {
    try {
      byte[] bytes = encodeBZ(data.getBytes("UTF-8"), dictionary);
      //assert(data.equals(decodeBZ(bytes, dictionary)));
      return bytes;
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
209996
@Override
    public Map<String, Object> toMap() {
        Map<String, Object> map = C.newMap();
        for (Map.Entry<String, ValueObject> entry : entrySet()) {
            map.put(entry.getKey(), entry.getValue().value());
        }
        return map;
    }
387533
public JsonWriter key(CharSequence key) {
        startKey();

        if (key == null) {
            throw new IllegalArgumentException("Expected map key, but got null.");
        }

        writeQuotedAndEscaped(key);
        writer.write(':');
        return this;
    }
871132
public static Map<String, String> arrayToMap(String[] args) {
    if (args.length % 2 != 0) {
      throw new IllegalArgumentException("Must pass in an even number of args, one key per value.");
    }

    Map<String, String> ret = new HashMap<>();

    for (int i = 0; i < args.length; i += 2) {
      ret.put(args[i], args[i + 1]);
    }

    return ret;
  }
449173
private String getKey(String key) throws IllegalArgumentException {
    String checkKey =
        JobHistoryKeys.HADOOP2_TO_HADOOP1_MAPPING.containsKey(key) ? JobHistoryKeys.HADOOP2_TO_HADOOP1_MAPPING
            .get(key) : key;
    return (JobHistoryKeys.valueOf(checkKey).toString());
  }
840457
@Override
    public MutableArray getArray(@NonNull String key) {
        return ((MutableDictionary) internalDict).getArray(key);
    }
81894
@SuppressWarnings("unchecked")
    public T dictionary(String dictionaryName) {
        Assert.notNull(applicationContext, "Citrus application context is not initialized!");
        DataDictionary dictionary = applicationContext.getBean(dictionaryName, DataDictionary.class);

        getAction().setDataDictionary(dictionary);
        return self;
    }
1036734
public static Map<String, String> toStringMap(final Props props, final boolean localOnly) {
    final HashMap<String, String> map = new HashMap<>();
    final Set<String> keyset = localOnly ? props.localKeySet() : props.getKeySet();

    for (final String key : keyset) {
      final String value = props.get(key);
      map.put(key, value);
    }

    return map;
  }
988183
private Object writeMapComplex(SerIterator itemIterator) {
        Map<String, Object> result = new LinkedHashMap<>();
        while (itemIterator.hasNext()) {
            itemIterator.next();
            Object key = itemIterator.key();
            if (key == null) {
                throw new IllegalArgumentException("Unable to write map key as it cannot be null");
            }
            String str = settings.getConverter().convertToString(itemIterator.key());
            if (str == null) {
                throw new IllegalArgumentException("Unable to write map key as it cannot be a null string");
            }
            result.put(str, writeObject(itemIterator.valueType(), itemIterator.value(), itemIterator));
        }
        return result;
    }
1063635
public SoyDict newDictFromMap(Map<String, ?> javaStringMap) {
    // Create a dictionary backed by a map which has eagerly converted each value into a lazy
    // value provider. Specifically, the map iteration is done eagerly so that the lazy value
    // provider can cache its value.
    ImmutableMap.Builder<String, SoyValueProvider> builder = ImmutableMap.builder();
    for (Map.Entry<String, ?> entry : javaStringMap.entrySet()) {
      builder.put(entry.getKey(), convertLazy(entry.getValue()));
    }
    return DictImpl.forProviderMap(
        builder.build(),
        // This Java map could represent a Soy legacy_object_map, a Soy map, or a Soy record.
        // We don't know which until one of the SoyMap, SoyLegacyObjectMap, or SoyRecord methods
        // is invoked on it.
        RuntimeMapTypeTracker.Type.UNKNOWN);
  }
286529
private HashMap<List<String>, String> getLemmaTagsDict(final String word) {
    final List<WordData> wdList = this.dictLookup.lookup(word);
    final HashMap<List<String>, String> dictMap = new HashMap<List<String>, String>();
    for (final WordData wd : wdList) {
      final List<String> wordLemmaTags = new ArrayList<String>();
      wordLemmaTags.add(word);
      wordLemmaTags.add(wd.getTag().toString());
      dictMap.put(wordLemmaTags, wd.getStem().toString());
    }
    return dictMap;
  }
1222013
public Map<String, Object> toMap() {
        Map<String, Object> result = new HashMap<>();
        for (Entry<Key, Value> keyValueEntry : fields.entrySet()) {
            Key key = keyValueEntry.getKey();
            Value value = keyValueEntry.getValue();
            if (!key.isExtension()) {
                result.put(key.getName(), transformValueToObject(value));
            } else {
                result.put("(" + key.getName() + ")", transformValueToObject(value));
            }
        }
        return result;
    }
976996
def serialize_dictionary(dictionary):
    
    string_value = {}
    for k, v in list(dictionary.items()):
        if isinstance(v, QUrl):
            string_value[k] = v.toString()
        elif isinstance(v, (QDate, QDateTime)):
            string_value[k] = v.toString(Qt.ISODate)
        elif isinstance(v, datetime):
            string_value[k] = v.isoformat()
        elif isinstance(v, date):
            string_value[k] = v.isoformat()
        elif isinstance(v, dict):
            # Recursive call
            string_value[k] = serialize_dictionary(v)
        else:
            string_value[k] = v
    return string_value
219432
public static Map<String, ?> propsToStringKeyMap(Properties properties) {
    ImmutableMap.Builder<String, Object> mapBuilder = ImmutableMap.builder();
    for (Map.Entry<Object, Object> entry : properties.entrySet()) {
      mapBuilder.put(entry.getKey().toString(), entry.getValue());
    }
    return mapBuilder.build();
  }
734570
@Override
    public V put(K key, V value) {
        if (isReadyOnly())
            throw new UnsupportedOperationException("Can't add property to read-only dictionary");

        return this.localMap.put(key, value);
    }
784755
public static Dictionary<String, String> putAll(Dictionary<String, String> sourceDictionary, Dictionary<String, String> destDictionary)
    {
        if (destDictionary == null)
            destDictionary = new Hashtable<String, String>();
        if (sourceDictionary != null)
        {
            Enumeration<String> keys = sourceDictionary.keys();
            while (keys.hasMoreElements())
            {
                String key = keys.nextElement();
                destDictionary.put(key, sourceDictionary.get(key));
            }
        }
        return destDictionary;
    }