Guest User

Untitled

a guest
Jan 31st, 2015
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.07 KB | None | 0 0
  1. String result =
  2.       (String)list.collectFirst(new AbstractPartialFunction()
  3.       {
  4.         public final boolean isDefinedAt(Map<String, Object> x1)
  5.         {
  6.           Map localMap = x1;
  7.           boolean bool;
  8.           if (localMap.get("a").isEmpty()) {
  9.             bool = true;
  10.           } else if (localMap.get("b").isEmpty()) {
  11.             bool = true;
  12.           } else {
  13.             bool = false;
  14.           }
  15.           return bool;
  16.         }
  17.        
  18.         public final <A1 extends Map<String, Object>, B1> B1 applyOrElse(A1 x1, Function1<A1, B1> default)
  19.         {
  20.           Map localMap = x1;
  21.           Object localObject;
  22.           if (localMap.get("a").isEmpty()) {
  23.             localObject = "Error A";
  24.           } else if (localMap.get("b").isEmpty()) {
  25.             localObject = "Error B";
  26.           } else {
  27.             localObject = default.apply(x1);
  28.           }
  29.           return localObject;
  30.         }
  31.       }).getOrElse(new AbstractFunction0()
  32.       {
  33.         public final String apply()
  34.         {
  35.           return "";
  36.         }
  37.       });
Advertisement
Add Comment
Please, Sign In to add comment