Libraryless. Click here for Pure Java version (2979L/17K).
1 | static <A> A mapMethodLike inlineSwappable(S fieldName, O host, IF0<A> defaultCalculation) { |
2 | if (nempty(fieldName)) { |
3 | IF0<A> replacement = cast getOpt(host, fieldName); |
4 | if (replacement != null) ret replacement!; |
5 | } |
6 | ret defaultCalculation!; |
7 | } |
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1031791 |
Snippet name: | inlineSwappable - lightweight code swapping mechanism using lambdas and dynamic fields |
Eternal ID of this version: | #1031791/2 |
Text MD5: | ae428c8b8f7354a1b537166c7fe95d96 |
Transpilation MD5: | 5a132e50469edab81d4235d179781352 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-06-30 01:23:03 |
Source code size: | 260 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 170 / 214 |
Version history: | 1 change(s) |
Referenced in: | [show references] |