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

36
LINES

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

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

Libraryless. Click here for Pure Java version (3932L/23K).

sinterface IMeta {
  // see class "Meta" for the bla bla
  
  public void _setMeta(O meta);
  public O _getMeta();
  default public IAutoCloseableF0 _tempMetaMutex() {
    ret new IAutoCloseableF0 {
      public O get() { ret IMeta.this; }
      public void close {}
    };
  }
  
  // actually query another object
  default public O metaGet aka getMeta(O obj, O key) {
    // call global function
    ret metaMapGet(obj, key);
  }
  
  default public O metaGet aka getMeta(O key) {
    if (key == null) null;
    O meta = _getMeta();
    if (meta cast Map) ret meta.get(key);
    null;
  }
  
  default public void metaPut aka metaSet(IMeta obj, O key, O value) {
    // call global function
    metaMapPut(obj, key, value);
  }
  
  default public void metaPut aka metaSet(O key, O value) {
    if (key == null) ret;
    Map map = convertObjectMetaToMap(this);
    syncMapPutOrRemove(map, key, value);
  }
}

Author comment

Began life as a copy of #1031838

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1031839
Snippet name: IMeta - interface for Meta (#1031838)
Eternal ID of this version: #1031839/15
Text MD5: be2d549adf22fca617db134e4e9e120d
Transpilation MD5: cf65e8355caad0dd1428653fefdaad8d
Author: stefan
Category: javax / reasoning
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-22 16:19:59
Source code size: 945 bytes / 36 lines
Pitched / IR pitched: No / No
Views / Downloads: 70 / 366
Version history: 14 change(s)
Referenced in: [show references]