Skip to content

Commit

Permalink
override resultType method
Browse files Browse the repository at this point in the history
  • Loading branch information
jenschude committed Oct 12, 2023
1 parent d1e2c5b commit 5041e97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class JavaHttpRequestRenderer constructor(override val vrapTypeProvider: VrapTyp
} else {
null
}
val apiMethodClass = if(bodyType != null) "BodyApiMethod" else "ApiMethod"
val apiMethodClass = if(bodyType != null) "TypeBodyApiMethod" else "TypeApiMethod"
val bodyTypeClass = if(bodyType != null) ", ${bodyType.`package`.toJavaPackage()}.${bodyType.simpleName()}" else ""

val content = """
Expand Down Expand Up @@ -101,6 +101,7 @@ class JavaHttpRequestRenderer constructor(override val vrapTypeProvider: VrapTyp
|@Deprecated""" else ""}
|public class ${type.toRequestName()} extends $apiMethodClass\<${type.toRequestName()}, ${type.javaReturnType(vrapTypeProvider)}$bodyTypeClass\>${if (implements.isNotEmpty()) " implements ${implements.joinToString(", ")}" else ""} {
|
| @Override
| public TypeReference\<${type.javaReturnType(vrapTypeProvider)}\> resultType() {
| return new TypeReference\<${type.javaReturnType(vrapTypeProvider)}\>() {
| };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class JavaStringHttpRequestRenderer constructor(override val vrapTypeProvider: V
|@Deprecated""" else ""}
|public class ${type.toStringRequestName()} extends StringBodyApiMethod\<${type.toStringRequestName()}, ${type.javaReturnType(vrapTypeProvider)}\>${if (implements.isNotEmpty()) " implements ${implements.joinToString(", ")}" else ""} {
|
| @Override
| public TypeReference\<${type.javaReturnType(vrapTypeProvider)}\> resultType() {
| return new TypeReference\<${type.javaReturnType(vrapTypeProvider)}\>() {
| };
Expand Down

0 comments on commit 5041e97

Please sign in to comment.