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).

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

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: 152 / 219
Version history: 3 change(s)
Referenced in: [show references]