Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String result =
- (String)list.collectFirst(new AbstractPartialFunction()
- {
- public final boolean isDefinedAt(Map<String, Object> x1)
- {
- Map localMap = x1;
- boolean bool;
- if (localMap.get("a").isEmpty()) {
- bool = true;
- } else if (localMap.get("b").isEmpty()) {
- bool = true;
- } else {
- bool = false;
- }
- return bool;
- }
- public final <A1 extends Map<String, Object>, B1> B1 applyOrElse(A1 x1, Function1<A1, B1> default)
- {
- Map localMap = x1;
- Object localObject;
- if (localMap.get("a").isEmpty()) {
- localObject = "Error A";
- } else if (localMap.get("b").isEmpty()) {
- localObject = "Error B";
- } else {
- localObject = default.apply(x1);
- }
- return localObject;
- }
- }).getOrElse(new AbstractFunction0()
- {
- public final String apply()
- {
- return "";
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment