Libraryless. Click here for Pure Java version (66L/1K).
static <A> AutoCloseable tempSetGeneric(IF0<A> getter, IVF1<A> setter, A newValue) { A value = getter!; if (eq(value, newValue)) null; setter.get(newValue); ret -> setter.get(value); }
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1035550 |
Snippet name: | tempSetGeneric - temporarily set a virtual variable defined through a getter and a setter |
Eternal ID of this version: | #1035550/2 |
Text MD5: | 012aa7dfee0aad9600bdcd2937ccd08d |
Transpilation MD5: | d49cc265cb2c5a698fa681dc3088f9ff |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-06-16 13:31:14 |
Source code size: | 197 bytes / 6 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 146 / 172 |
Version history: | 1 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1035551 - tempPrintAlsoToSystemOut - make print() also print to System.out temporarily #1036403 - tempRestoreSCP - restore contents of SingleComponentPanel after block |