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

9
LINES

< > BotCompany Repo | #1030143 // str_shortenSyntheticAndStandardToString

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

Libraryless. Click here for Pure Java version (2888L/17K).

1  
sS str_shortenSyntheticAndStandardToString(O o) {
2  
  if (o == null) ret "null";
3  
  if (isInstanceOfSyntheticClass(o)) ret "Synthetic instance of " + joinWithSlash(map(c -> "interface " + shortClassName(c), o.getClass().getInterfaces()));
4  
  if (o instanceof Class) ret "class " + shortName(o);
5  
  if (isArray(o))
6  
    ret arrayElementType(o) + "[" + arrayLength(o) + "]";
7  
  if (!implementsCustomToString(o)) ret "Instance of " + shortClassName(o);
8  
  ret str(o);
9  
}

Author comment

Began life as a copy of #1030054

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1030143
Snippet name: str_shortenSyntheticAndStandardToString
Eternal ID of this version: #1030143/8
Text MD5: 71e3e988b178cec6e649a1616a2de200
Transpilation MD5: b301b424a1abddd5d4143e6a30ee4c04
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-01-07 00:04:35
Source code size: 466 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 152 / 232
Version history: 7 change(s)
Referenced in: [show references]