Skip to content

Commit

Permalink
ClassSignatureBuilder - rename addSuperInterface() to addInterface()
Browse files Browse the repository at this point in the history
  • Loading branch information
mkouba committed Jan 10, 2023
1 parent 634a4b6 commit 5a28fa8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/quarkus/gizmo/ClassSignatureBuilderImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ public ClassSignatureBuilder setSuperClass(ParameterizedType superClass) {
}

@Override
public ClassSignatureBuilder addSuperInterface(ClassType interfaceType) {
public ClassSignatureBuilder addInterface(ClassType interfaceType) {
superInterfaces.add(interfaceType);
return this;
}

@Override
public ClassSignatureBuilder addSuperInterface(ParameterizedType interfaceType) {
public ClassSignatureBuilder addInterface(ParameterizedType interfaceType) {
if (containsWildcard(interfaceType)) {
throw new IllegalArgumentException("A super type may not specify a wilcard");
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/quarkus/gizmo/SignatureBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ interface ClassSignatureBuilder extends SignatureBuilder {

ClassSignatureBuilder setSuperClass(ParameterizedType superClass);

ClassSignatureBuilder addSuperInterface(ClassType interfaceType);
ClassSignatureBuilder addInterface(ClassType interfaceType);

ClassSignatureBuilder addSuperInterface(ParameterizedType interfaceType);
ClassSignatureBuilder addInterface(ParameterizedType interfaceType);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/io/quarkus/gizmo/SignaturesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ public void testClassSignatures() {
SignatureBuilder.forClass()
.addTypeParameter(Type.typeVariable("T"))
.setSuperClass(Type.parameterizedType(Type.classType(List.class), Type.typeVariable("T")))
.addSuperInterface(Type.classType(Serializable.class))
.addSuperInterface(Type.parameterizedType(Type.classType(Comparable.class), Type.typeVariable("T")))
.addInterface(Type.classType(Serializable.class))
.addInterface(Type.parameterizedType(Type.classType(Comparable.class), Type.typeVariable("T")))
.build());

// public class OuterParam<T extends Serializable> {
Expand Down Expand Up @@ -243,7 +243,7 @@ public void testClassSignatures() {
.innerClass("InnerInnerRaw")
.innerParameterizedType("InnerInnerInnerParam", Type.classType(String.class))
)
.addSuperInterface(Type.parameterizedType(Type.classType("io.quarkus.gizmo.test.OuterParam$NestedParam"), Type.typeVariable("V")))
.addInterface(Type.parameterizedType(Type.classType("io.quarkus.gizmo.test.OuterParam$NestedParam"), Type.typeVariable("V")))
.build());

try {
Expand Down

0 comments on commit 5a28fa8

Please sign in to comment.