File tree Expand file tree Collapse file tree
restx-common/src/main/java/restx/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,6 +57,46 @@ public boolean equals(Object obj) {
5757 }
5858 return false ;
5959 }
60+
61+ @ Override
62+ public String toString () {
63+ StringBuilder sb = new StringBuilder ();
64+ Type ownerType = getOwnerType ();
65+ if (ownerType != null ) {
66+ if (ownerType instanceof Class ) {
67+ sb .append (((Class ) ownerType ).getName ());
68+ } else {
69+ sb .append (ownerType .toString ());
70+ }
71+
72+ sb .append ("." );
73+ if (ownerType instanceof ParameterizedType ) {
74+
75+ sb .append (rawType .getName ().replace (((Class ) ((ParameterizedType ) ownerType ).getRawType ()).getName () + "$" , "" ));
76+ } else {
77+ sb .append (rawType .getName ());
78+ }
79+ } else {
80+ sb .append (rawType .getName ());
81+ }
82+
83+ if (arguments != null && arguments .length > 0 ) {
84+ sb .append ("<" );
85+ boolean first = true ;
86+
87+ for (Type current : arguments ) {
88+ if (!first ) {
89+ sb .append (", " );
90+ }
91+ sb .append (current .toString ()); // getTypeName() in jse8
92+ first = false ;
93+ }
94+
95+ sb .append (">" );
96+ }
97+
98+ return sb .toString ();
99+ }
60100 };
61101 }
62102
You can’t perform that action at this time.
0 commit comments