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

6
LINES

< > BotCompany Repo | #1035550 // tempSetGeneric - temporarily set a virtual variable defined through a getter and a setter

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

Libraryless. Click here for Pure Java version (66L/1K).

1  
static <A> AutoCloseable tempSetGeneric(IF0<A> getter, IVF1<A> setter, A newValue) {
2  
  A value = getter!;
3  
  if (eq(value, newValue)) null;
4  
  setter.get(newValue);
5  
  ret -> setter.get(value);
6  
}

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: 145 / 171
Version history: 1 change(s)
Referenced in: [show references]