> @@ -46,6 +46,21 @@ public String toString() {
> }
> };
> }
> +
> + public static <K, V> Supplier<V> getValueInMapOrNull(final
> Supplier<Map<K, Supplier<V>>> input, final K keyValue) {
> + return new Supplier<V>() {
> + @Override
> + public V get() {
> + Map<K, Supplier<V>> map = input.get();
> + return map.containsKey(keyValue) ? map.get(keyValue).get() :
> null;
> + }
> +
> + @Override
> + public String toString() {
> + return String.format("getValueInMapOrNull('%1$s')", keyValue);
> + }
If that's a convention we're using elsewhere (i.e. to have a `toString`), fine
with me and a lesson learned on my side ;-) Thanks!
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/31/files#r4863827