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

12
LINES

< > BotCompany Repo | #1023270 // assertNotNullVerbose

JavaX fragment (include)

static <A> A assertNotNullVerbose(A y) {
  assertNotNullVerbose((S) null, y);
  ret y;
}

static <A> A assertNotNullVerbose(S msg, A y) {
  if (y == null) {
    fail((msg != null ? msg + ": " : "") + "value is null");
  } else
    print("OK (not null): " + y);
  ret y;
}

Author comment

Began life as a copy of #1002936

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023270
Snippet name: assertNotNullVerbose
Eternal ID of this version: #1023270/1
Text MD5: 6ab048fd8a5fe27cccf29d96fe41f6dc
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-05-21 16:42:51
Source code size: 282 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 297 / 305
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)