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

14
LINES

< > BotCompany Repo | #1002022 - isEmpty - check strings or collections for emptiness

JavaX fragment (include)

static boolean isEmpty(Collection c) {
  ret c == null || c.isEmpty();
}

static boolean isEmpty(CharSequence s) {
  ret s == null || s.length() == 0;
}

static bool isEmpty(O[] a) { ret a == null || a.length == 0; }
static bool isEmpty(byte[] a) { ret a == null || a.length == 0; }

static boolean isEmpty(Map map) {
  ret map == null || map.isEmpty();
}

download  show line numbers  debug dex   

Travelled to 15 computer(s): aoiabmzegqzx, ayfdnjdhpjha, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, kltaiputbqfu, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, ppjhyzlbdabe, tslmcundralx, tvejysmllsmz, whxojlpjdney

No comments. add comment

Snippet ID: #1002022
Snippet name: isEmpty - check strings or collections for emptiness
Eternal ID of this version: #1002022/2
Text MD5: ad41409509561c38ef05f032d219932a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-11 03:10:13
Source code size: 368 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 527 / 6274
Version history: 1 change(s)
Referenced in: [show references]