Package org.forgerock.openig.tools
Class Utils
java.lang.Object
org.forgerock.openig.tools.Utils
Utility class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceHash a non-null value, returns a base64 encoded String of the hash.static final classSHA-256 implementation of theUtils.Digestinterface. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>Returns an immutableList.static <K,V> Map<K, V> immutableMap(Map<K, V> map, Supplier<Map<K, V>> supplier) Creates an immutableMap.throwableCauses(Throwable throwable)
-
Method Details
-
immutable
Returns an immutableList.- Type Parameters:
T- The type of elements of this list.- Parameters:
list- The original list to copy.listSupplier- A function which returns a new emptyListinto which the results will be inserted.- Returns:
- An immutable list of strings.
-
immutableMap
Creates an immutableMap.Note: This method uses a reference for the value. If the map value is not a primitive type, such as a list of strings, you may consider using
.immutablemethod before creating yourimmutableMap- Type Parameters:
K- Key type of theMap.V- Value type of theMap.- Parameters:
map- The original map to copy.supplier- A function which returns a new emptyMapinto which the results will be inserted.- Returns:
- An immutable
Map.
-
throwableCauses
-