Package com.rabbitmq.utility
Class Utility
java.lang.Object
com.rabbitmq.utility.Utility
Catch-all holder class for static helper methods.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E> List
<E> Synchronizes on the list and then returns a copy of the list that is safe to iterate over.static <K,
V> Map <K, V> Synchronizes on the map and then returns a copy of the map that is safe to iterate over.static <E> Set
<E> Synchronizes on the set and then returns a copy of the set that is safe to iterate over.static <T extends Throwable & SensibleClone<T>>
TfixStackTrace
(T throwable) static String
makeStackTrace
(Throwable throwable) Deprecated.use logging library instead for logging stack traces somewhere
-
Constructor Details
-
Utility
public Utility()
-
-
Method Details
-
fixStackTrace
-
makeStackTrace
Deprecated.use logging library instead for logging stack traces somewhere- Parameters:
throwable
-- Returns:
-
copy
Synchronizes on the set and then returns a copy of the set that is safe to iterate over. Useful when wanting to do thread-safe iteration over a Set wrapped inCollections.synchronizedSet(Set)
.- Parameters:
set
- The set, which may not benull
- Returns:
- LinkedHashSet copy of the set
-
copy
Synchronizes on the list and then returns a copy of the list that is safe to iterate over. Useful when wanting to do thread-safe iteration over a List wrapped inCollections.synchronizedList(List)
.- Parameters:
list
- The list, which may not benull
- Returns:
- ArrayList copy of the list
-
copy
Synchronizes on the map and then returns a copy of the map that is safe to iterate over. Useful when wanting to do thread-safe iteration over a Map wrapped inCollections.synchronizedMap(Map)
- Parameters:
map
- The map, which may not benull
- Returns:
- LinkedHashMap copy of the map
-