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

7
LINES

< > BotCompany Repo | #1030016 - assertAllElementsAreOfType - also allows nulls

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

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

static <A extends Cl> A assertAllElementsAreOfType(Class type, A l) {
  if (l != null)
    for (O x : l)
      if (!isInstanceOrNull(type, x))
        fail("Element " + className(x) + " not of type " + type);
  ret l;
}

Author comment

Began life as a copy of #1014366

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1030016
Snippet name: assertAllElementsAreOfType - also allows nulls
Eternal ID of this version: #1030016/4
Text MD5: fc7f91d79589ebd8c8d7647687e33d52
Transpilation MD5: f7703eaadbb609fb9bec89e24a4336f7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-10-30 09:21:15
Source code size: 225 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 46 / 83
Version history: 3 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1030016 & http://1030016.tinybrain.de