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

24
LINES

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

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

Transpiled version (41L) is out of date.

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();
}

ifclass DoubleRange
sbool isEmpty(DoubleRange r) { ret r == null || r.isEmpty(); }
endif

ifclass AppendableChain
sbool isEmpty(AppendableChain c) { ret c == null; }
endif

sbool isEmpty(IntSize l) { ret l == null || l.size() == 0; }

download  show line numbers  debug dex  old transpilations   

Travelled to 20 computer(s): aoiabmzegqzx, ayfdnjdhpjha, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, kltaiputbqfu, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, ppjhyzlbdabe, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv

No comments. add comment

Snippet ID: #1002022
Snippet name: isEmpty - check strings or collections for emptiness
Eternal ID of this version: #1002022/7
Text MD5: 5eab08a64afb07b1bcfa4fc81073bb40
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-09-21 20:00:35
Source code size: 613 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 773 / 6714
Version history: 6 change(s)
Referenced in: [show references]