If the specified key is a KeySupplier, the 'root' (lowest level) key that may exist in a KeySupplier chain is returned, otherwise the key is returned. @param key the key to check if it is a KeySupplier @param the key type @return the lowest-level/root key
(K key)
| 63 | * @return the lowest-level/root key available. |
| 64 | */ |
| 65 | @SuppressWarnings("unchecked") |
| 66 | public static <K extends Key> K root(K key) { |
| 67 | return (key instanceof KeySupplier<?>) ? (K) root((KeySupplier<?>) key) : key; |
| 68 | } |
| 69 | |
| 70 | public static <K extends Key> K root(KeySupplier<K> supplier) { |
| 71 | Assert.notNull(supplier, "KeySupplier canot be null."); |