diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/J.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/J.java index 1f4ab2a97a6..8e16d3b757d 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/J.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/J.java @@ -1222,6 +1222,12 @@ public ClassDeclaration withPrimaryConstructor(@Nullable List primary @Nullable JLeftPadded extendings; + /** + * This is used to access the parent class. + * + * @return The parent class of the ClassDeclaration. If the ClassDeclaration is a class, this will return the + * class specified by the 'extends' keyword. If the ClassDeclaration is an interface, this will return null. + */ public @Nullable TypeTree getExtends() { return extendings == null ? null : extendings.getElement(); } @@ -1233,6 +1239,13 @@ public ClassDeclaration withExtends(@Nullable TypeTree extendings) { @Nullable JContainer implementings; + /** + * This is used to access the parent interfaces. + * + * @return A list of the parent interfaces of the ClassDeclaration. If the ClassDeclaration is a class, this + * will return the interfaces specified by the 'implements' keyword. If the ClassDeclaration is an interface, + * this will return the interfaces specified by the 'extends' keyword. + */ public @Nullable List getImplements() { return implementings == null ? null : implementings.getElements(); }