@@ -197,9 +197,10 @@ public int getModifiers() {
197197 }
198198
199199 /**
200- * Returns the parsed type descriptor for the field, if available.
200+ * Returns the parsed type descriptor for the field, which will not include type parameters. If you need generic
201+ * type parameters, call {@link #getTypeSignature()} instead.
201202 *
202- * @return The parsed type descriptor for the field, if available, else returns null .
203+ * @return The parsed type descriptor string for the field.
203204 */
204205 public TypeSignature getTypeDescriptor () {
205206 if (typeDescriptorStr == null ) {
@@ -217,9 +218,21 @@ public TypeSignature getTypeDescriptor() {
217218 }
218219
219220 /**
220- * Returns the parsed type signature for the field, if available.
221+ * Returns the type descriptor string for the field, which will not include type parameters. If you need generic
222+ * type parameters, call {@link #getTypeSignatureStr()} instead.
221223 *
222- * @return The parsed type signature for the field, if available, else returns null.
224+ * @return The type descriptor string for the field.
225+ */
226+ public String getTypeDescriptorStr () {
227+ return typeDescriptorStr ;
228+ }
229+
230+ /**
231+ * Returns the parsed type signature for the field, possibly including type parameters. If this returns null,
232+ * indicating that no type signature information is available for this field, call {@link #getTypeDescriptor()}
233+ * instead.
234+ *
235+ * @return The parsed type signature for the field, or null if not available.
223236 */
224237 public TypeSignature getTypeSignature () {
225238 if (typeSignatureStr == null ) {
@@ -236,6 +249,17 @@ public TypeSignature getTypeSignature() {
236249 return typeSignature ;
237250 }
238251
252+ /**
253+ * Returns the type signature string for the field, possibly including type parameters. If this returns null,
254+ * indicating that no type signature information is available for this field, call
255+ * {@link #getTypeDescriptorStr()} instead.
256+ *
257+ * @return The type signature string for the field, or null if not available.
258+ */
259+ public String getTypeSignatureStr () {
260+ return typeSignatureStr ;
261+ }
262+
239263 /**
240264 * Returns the type signature for the field, possibly including type parameters. If the type signature is null,
241265 * indicating that no type signature information is available for this field, returns the type descriptor
@@ -253,6 +277,22 @@ public TypeSignature getTypeSignatureOrTypeDescriptor() {
253277 }
254278 }
255279
280+ /**
281+ * Returns the type signature string for the field, possibly including type parameters. If the type signature
282+ * string is null, indicating that no type signature information is available for this field, returns the type
283+ * descriptor string instead.
284+ *
285+ * @return The type signature string for the field, or if not available, the type descriptor string for the
286+ * method.
287+ */
288+ public String getTypeSignatureOrTypeDescriptorStr () {
289+ if (typeSignatureStr != null ) {
290+ return typeSignatureStr ;
291+ } else {
292+ return typeDescriptorStr ;
293+ }
294+ }
295+
256296 /**
257297 * Returns the constant initializer value of a constant final field. Requires
258298 * {@link ClassGraph#enableStaticFinalFieldConstantInitializerValues()} to have been called.
0 commit comments