Knopflerfish OSGi 5.2.0

org.knopflerfish.shared.cm
Class DictionaryUtils

java.lang.Object
  extended by org.knopflerfish.shared.cm.DictionaryUtils

public final class DictionaryUtils
extends java.lang.Object

Some utility methods for objects that implement Dictionary.

Author:
Gatespace AB

Constructor Summary
DictionaryUtils()
           
 
Method Summary
static
<K> java.util.Dictionary<K,java.lang.Object>
copyDictionary(java.util.Dictionary<K,java.lang.Object> in)
          Copy a dictionary.
static
<K> boolean
dictionariesAreEqual(java.util.Dictionary<K,java.lang.Object> first, java.util.Dictionary<K,java.lang.Object> second)
          Recursive comparison of two dictionaries for equality.
static
<K> boolean
dictionariesAreNotEqual(java.util.Dictionary<K,java.lang.Object> first, java.util.Dictionary<K,java.lang.Object> second)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DictionaryUtils

public DictionaryUtils()
Method Detail

copyDictionary

public static <K> java.util.Dictionary<K,java.lang.Object> copyDictionary(java.util.Dictionary<K,java.lang.Object> in)
Copy a dictionary. Deep copy where values aren't immutable. I.e. Vector and arrays.

Parameters:
in - The Dictionary to create a copy of.
Returns:
A copy of the Dictionary.

dictionariesAreEqual

public static <K> boolean dictionariesAreEqual(java.util.Dictionary<K,java.lang.Object> first,
                                               java.util.Dictionary<K,java.lang.Object> second)
Recursive comparison of two dictionaries for equality. Equality is defined as (o1 == null && 02 == null) || o1.equals(o2).

Parameters:
first - The first Dictionary to compare.
second - The second Dictionary to compare.
Returns:
true if both dictionaries are either null or recursively equal.

dictionariesAreNotEqual

public static <K> boolean dictionariesAreNotEqual(java.util.Dictionary<K,java.lang.Object> first,
                                                  java.util.Dictionary<K,java.lang.Object> second)

Knopflerfish OSGi 5.2.0