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

41
LINES

< > BotCompany Repo | #1031839 - IMeta - interface for Meta (#1031838)

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

Libraryless. Click here for Pure Java version (4786L/27K).

1  
sinterface IMeta {
2  
  // see class "Meta" for the bla bla
3  
  
4  
  public void _setMeta(O meta);
5  
  public O _getMeta();
6  
  default public IAutoCloseableF0 _tempMetaMutex() {
7  
    ret new IAutoCloseableF0 {
8  
      public O get() { ret IMeta.this; }
9  
      public void close {}
10  
    };
11  
  }
12  
  
13  
  // actually query another object
14  
  default public O metaGet aka getMeta(O obj, O key) {
15  
    // call global function
16  
    ret metaMapGet(obj, key);
17  
  }
18  
  
19  
  default public O metaGet(S key, O obj) {
20  
    // call global function
21  
    ret metaMapGet(obj, key);
22  
  }
23  
  
24  
  default public O metaGet aka getMeta(O key) {
25  
    if (key == null) null;
26  
    O meta = _getMeta();
27  
    if (meta cast Map) ret meta.get(key);
28  
    null;
29  
  }
30  
  
31  
  default public void metaPut aka metaSet(IMeta obj, O key, O value) {
32  
    // call global function
33  
    metaMapPut(obj, key, value);
34  
  }
35  
  
36  
  default public void metaPut aka metaSet(O key, O value) {
37  
    if (key == null) ret;
38  
    Map map = convertObjectMetaToMap(this);
39  
    syncMapPutOrRemove(map, key, value);
40  
  }
41  
}

Author comment

Began life as a copy of #1031838

download  show line numbers  debug dex  old transpilations   

Travelled to 5 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1031839
Snippet name: IMeta - interface for Meta (#1031838)
Eternal ID of this version: #1031839/16
Text MD5: 8e7cff8ab1f4511f064832b09dafb698
Transpilation MD5: 406d8b580e36c8e56effd1024b3adec8
Author: stefan
Category: javax / reasoning
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-02 19:58:14
Source code size: 1058 bytes / 41 lines
Pitched / IR pitched: No / No
Views / Downloads: 95 / 525
Version history: 15 change(s)
Referenced in: [show references]