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

4
LINES

< > BotCompany Repo | #1019897 // returnOrThrow_either - return if eitherA, throw if eitherB

JavaX fragment (include)

static <A> A returnOrThrow_either(Either<A, Throwable> e) {
  if (isEitherB(e)) throw rethrow(e.b());
  ret eitherAOpt(e);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019897
Snippet name: returnOrThrow_either - return if eitherA, throw if eitherB
Eternal ID of this version: #1019897/3
Text MD5: eef06df5ef9b883559e5cf08cfd86d18
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-30 20:30:32
Source code size: 127 bytes / 4 lines
Pitched / IR pitched: No / No
Views / Downloads: 283 / 316
Version history: 2 change(s)
Referenced in: [show references]