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

10
LINES

< > BotCompany Repo | #1025423 // matchRecordWithTypes

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

Libraryless. Click here for Pure Java version (2135L/14K).

1  
sbool matchRecordWithTypes(IFieldsToList record, Class... types) {
2  
  O[] l = record._fieldsToList();
3  
  int n = l(l);
4  
  if (n != l(types))
5  
    fail("Wrong number of arguments for " + className(record) + " " + asList(types));
6  
  for i to n:
7  
    if (!isInstanceX(types[i], l[i]))
8  
      false;
9  
  true;
10  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1025423
Snippet name: matchRecordWithTypes
Eternal ID of this version: #1025423/4
Text MD5: 0f6475e9da76d9e41066e0b3612ea2d9
Transpilation MD5: 2250546160506dd4187444b96d32157e
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-28 22:46:17
Source code size: 307 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 207 / 318
Version history: 3 change(s)
Referenced in: [show references]