Issue #6830: Java server - Add getter to ApiException templates (#7150)

This commit is contained in:
Vincent Leon 2020-08-09 12:17:51 +02:00 committed by GitHub
parent f1989cc70f
commit 930c622d11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 312 additions and 26 deletions

View File

@ -1,10 +1,32 @@
package {{apiPackage}}; package {{apiPackage}};
/**
* The exception that can be used to store the HTTP status code returned by an API response.
*/
{{>generatedAnnotation}} {{>generatedAnnotation}}
public class ApiException extends Exception{ public class ApiException extends Exception {
/** The HTTP status code. */
private int code; private int code;
public ApiException (int code, String msg) {
/**
* Constructor.
*
* @param code The HTTP status code.
* @param msg The error message.
*/
public ApiException(int code, String msg) {
super(msg); super(msg);
this.code = code; this.code = code;
} }
/**
* Get the HTTP status code.
*
* @return The HTTP status code.
*/
public int getCode() {
return code;
}
} }

View File

@ -1,10 +1,32 @@
package {{apiPackage}}; package {{apiPackage}};
/**
* The exception that can be used to store the HTTP status code returned by an API response.
*/
{{>generatedAnnotation}} {{>generatedAnnotation}}
public class ApiException extends Exception{ public class ApiException extends Exception {
/** The HTTP status code. */
private int code; private int code;
public ApiException (int code, String msg) {
/**
* Constructor.
*
* @param code The HTTP status code.
* @param msg The error message.
*/
public ApiException(int code, String msg) {
super(msg); super(msg);
this.code = code; this.code = code;
} }
/**
* Get the HTTP status code.
*
* @return The HTTP status code.
*/
public int getCode() {
return code;
}
} }

View File

@ -1,10 +1,32 @@
package {{apiPackage}}; package {{apiPackage}};
/**
* The exception that can be used to store the HTTP status code returned by an API response.
*/
{{>generatedAnnotation}} {{>generatedAnnotation}}
public class ApiException extends Exception{ public class ApiException extends Exception {
/** The HTTP status code. */
private int code; private int code;
public ApiException (int code, String msg) {
/**
* Constructor.
*
* @param code The HTTP status code.
* @param msg The error message.
*/
public ApiException(int code, String msg) {
super(msg); super(msg);
this.code = code; this.code = code;
} }
/**
* Get the HTTP status code.
*
* @return The HTTP status code.
*/
public int getCode() {
return code;
}
} }

View File

@ -1,10 +1,32 @@
package {{apiPackage}}; package {{apiPackage}};
/**
* The exception that can be used to store the HTTP status code returned by an API response.
*/
{{>generatedAnnotation}} {{>generatedAnnotation}}
public class ApiException extends Exception{ public class ApiException extends Exception {
/** The HTTP status code. */
private int code; private int code;
public ApiException (int code, String msg) {
/**
* Constructor.
*
* @param code The HTTP status code.
* @param msg The error message.
*/
public ApiException(int code, String msg) {
super(msg); super(msg);
this.code = code; this.code = code;
} }
/**
* Get the HTTP status code.
*
* @return The HTTP status code.
*/
public int getCode() {
return code;
}
} }

View File

@ -1,10 +1,32 @@
package org.openapitools.api; package org.openapitools.api;
/**
* The exception that can be used to store the HTTP status code returned by an API response.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaMSF4JServerCodegen") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaMSF4JServerCodegen")
public class ApiException extends Exception{ public class ApiException extends Exception {
/** The HTTP status code. */
private int code; private int code;
public ApiException (int code, String msg) {
/**
* Constructor.
*
* @param code The HTTP status code.
* @param msg The error message.
*/
public ApiException(int code, String msg) {
super(msg); super(msg);
this.code = code; this.code = code;
} }
/**
* Get the HTTP status code.
*
* @return The HTTP status code.
*/
public int getCode() {
return code;
}
} }

View File

@ -1,10 +1,32 @@
package org.openapitools.api; package org.openapitools.api;
/**
* The exception that can be used to store the HTTP status code returned by an API response.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
public class ApiException extends Exception{ public class ApiException extends Exception {
/** The HTTP status code. */
private int code; private int code;
public ApiException (int code, String msg) {
/**
* Constructor.
*
* @param code The HTTP status code.
* @param msg The error message.
*/
public ApiException(int code, String msg) {
super(msg); super(msg);
this.code = code; this.code = code;
} }
/**
* Get the HTTP status code.
*
* @return The HTTP status code.
*/
public int getCode() {
return code;
}
} }

View File

@ -1,10 +1,32 @@
package org.openapitools.api; package org.openapitools.api;
/**
* The exception that can be used to store the HTTP status code returned by an API response.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
public class ApiException extends Exception{ public class ApiException extends Exception {
/** The HTTP status code. */
private int code; private int code;
public ApiException (int code, String msg) {
/**
* Constructor.
*
* @param code The HTTP status code.
* @param msg The error message.
*/
public ApiException(int code, String msg) {
super(msg); super(msg);
this.code = code; this.code = code;
} }
/**
* Get the HTTP status code.
*
* @return The HTTP status code.
*/
public int getCode() {
return code;
}
} }

View File

@ -1,10 +1,32 @@
package org.openapitools.api; package org.openapitools.api;
/**
* The exception that can be used to store the HTTP status code returned by an API response.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen")
public class ApiException extends Exception{ public class ApiException extends Exception {
/** The HTTP status code. */
private int code; private int code;
public ApiException (int code, String msg) {
/**
* Constructor.
*
* @param code The HTTP status code.
* @param msg The error message.
*/
public ApiException(int code, String msg) {
super(msg); super(msg);
this.code = code; this.code = code;
} }
/**
* Get the HTTP status code.
*
* @return The HTTP status code.
*/
public int getCode() {
return code;
}
} }

View File

@ -1,10 +1,32 @@
package org.openapitools.api; package org.openapitools.api;
/**
* The exception that can be used to store the HTTP status code returned by an API response.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen")
public class ApiException extends Exception{ public class ApiException extends Exception {
/** The HTTP status code. */
private int code; private int code;
public ApiException (int code, String msg) {
/**
* Constructor.
*
* @param code The HTTP status code.
* @param msg The error message.
*/
public ApiException(int code, String msg) {
super(msg); super(msg);
this.code = code; this.code = code;
} }
/**
* Get the HTTP status code.
*
* @return The HTTP status code.
*/
public int getCode() {
return code;
}
} }

View File

@ -1,10 +1,32 @@
package org.openapitools.api; package org.openapitools.api;
/**
* The exception that can be used to store the HTTP status code returned by an API response.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
public class ApiException extends Exception{ public class ApiException extends Exception {
/** The HTTP status code. */
private int code; private int code;
public ApiException (int code, String msg) {
/**
* Constructor.
*
* @param code The HTTP status code.
* @param msg The error message.
*/
public ApiException(int code, String msg) {
super(msg); super(msg);
this.code = code; this.code = code;
} }
/**
* Get the HTTP status code.
*
* @return The HTTP status code.
*/
public int getCode() {
return code;
}
} }

View File

@ -1,10 +1,32 @@
package org.openapitools.api; package org.openapitools.api;
/**
* The exception that can be used to store the HTTP status code returned by an API response.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
public class ApiException extends Exception{ public class ApiException extends Exception {
/** The HTTP status code. */
private int code; private int code;
public ApiException (int code, String msg) {
/**
* Constructor.
*
* @param code The HTTP status code.
* @param msg The error message.
*/
public ApiException(int code, String msg) {
super(msg); super(msg);
this.code = code; this.code = code;
} }
/**
* Get the HTTP status code.
*
* @return The HTTP status code.
*/
public int getCode() {
return code;
}
} }

View File

@ -1,10 +1,32 @@
package org.openapitools.api; package org.openapitools.api;
/**
* The exception that can be used to store the HTTP status code returned by an API response.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
public class ApiException extends Exception{ public class ApiException extends Exception {
/** The HTTP status code. */
private int code; private int code;
public ApiException (int code, String msg) {
/**
* Constructor.
*
* @param code The HTTP status code.
* @param msg The error message.
*/
public ApiException(int code, String msg) {
super(msg); super(msg);
this.code = code; this.code = code;
} }
/**
* Get the HTTP status code.
*
* @return The HTTP status code.
*/
public int getCode() {
return code;
}
} }

View File

@ -1,10 +1,32 @@
package org.openapitools.api; package org.openapitools.api;
/**
* The exception that can be used to store the HTTP status code returned by an API response.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
public class ApiException extends Exception{ public class ApiException extends Exception {
/** The HTTP status code. */
private int code; private int code;
public ApiException (int code, String msg) {
/**
* Constructor.
*
* @param code The HTTP status code.
* @param msg The error message.
*/
public ApiException(int code, String msg) {
super(msg); super(msg);
this.code = code; this.code = code;
} }
/**
* Get the HTTP status code.
*
* @return The HTTP status code.
*/
public int getCode() {
return code;
}
} }