public <P> V getIfAbsentWith(K key, Function<? super P, ? extends V> function, P parameter) {
   V result = this.get(key);
   if (this.isAbsent(result, key)) {
     return function.valueOf(parameter);
   }
   return result;
 }
예제 #2
0
 @Override
 public String valueOf(T object) {
   for (Function<T, String> function : this.functions) {
     String result = function.valueOf(object);
     if (StringIterate.notEmpty(result)) {
       return result;
     }
   }
   return null;
 }
예제 #3
0
 @Override
 public I valueOf(T1 object) {
   for (Function<T1, I> function : this.functions) {
     I result = function.valueOf(object);
     if (Iterate.notEmpty(result)) {
       return result;
     }
   }
   return null;
 }
예제 #4
0
 @Override
 public V valueOf(T object) {
   for (Function<T, V> function : this.functions) {
     V result = function.valueOf(object);
     if (result != null) {
       return result;
     }
   }
   return null;
 }
예제 #5
0
 public static <T, V1, V2> Function<T, Pair<V1, V2>> pair(
     Function<? super T, V1> function1, Function<? super T, V2> function2) {
   return t -> Tuples.pair(function1.valueOf(t), function2.valueOf(t));
 }