Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1030298 // applyWhileNotNull

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2531L/16K).

1  
static <A> A lambdaMapLike applyWhileNotNull(IF1<A> f, A o) {
2  
  if (f == null || o == null) ret o;
3  
  while licensed {
4  
    A o2 = f.get(o);
5  
    if (o == null) break;
6  
    o = o2;
7  
  }
8  
  ret o;
9  
}

Author comment

Began life as a copy of #1028191

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030298
Snippet name: applyWhileNotNull
Eternal ID of this version: #1030298/1
Text MD5: bbc2de4671f4ea28621af0a66fb870f7
Transpilation MD5: d5e5a63a89fa61081452e5b102e629b5
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-28 00:00:34
Source code size: 199 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 140 / 196
Referenced in: [show references]