Simplified enum by changing CodeGenStatus to an enum instead of a wrapper. Updated version of swagger-parser to 1.0.9.

This commit is contained in:
tiffanyperumpail 2015-08-05 16:53:39 -07:00
parent 1b31a01b76
commit 5328c00e8f
3 changed files with 5 additions and 24 deletions

View File

@ -1,8 +1,5 @@
package io.swagger.codegen; package io.swagger.codegen;
import static io.swagger.codegen.languages.CodeGenStatus.Status.FAILED;
import static io.swagger.codegen.languages.CodeGenStatus.Status.SUCCESSFUL;
import static io.swagger.codegen.languages.CodeGenStatus.Status.UNRUN;
import static org.apache.commons.lang3.StringUtils.capitalize; import static org.apache.commons.lang3.StringUtils.capitalize;
import static org.apache.commons.lang3.StringUtils.isNotEmpty; import static org.apache.commons.lang3.StringUtils.isNotEmpty;
@ -44,7 +41,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
protected ClientOptInput opts = null; protected ClientOptInput opts = null;
protected Swagger swagger = null; protected Swagger swagger = null;
public CodeGenStatus status = new CodeGenStatus(UNRUN); public CodeGenStatus status = CodeGenStatus.UNRUN;
public Generator opts(ClientOptInput opts) { public Generator opts(ClientOptInput opts) {
this.opts = opts; this.opts = opts;
@ -310,9 +307,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
config.processSwagger(swagger); config.processSwagger(swagger);
status.setStatus(SUCCESSFUL); status = CodeGenStatus.SUCCESSFUL;
} catch (Exception e) { } catch (Exception e) {
status.setStatus(FAILED); status = CodeGenStatus.FAILED;
} }
return files; return files;
} }

View File

@ -1,21 +1,5 @@
package io.swagger.codegen.languages; package io.swagger.codegen.languages;
public class CodeGenStatus { public enum CodeGenStatus {
public enum Status {
UNRUN, SUCCESSFUL, FAILED UNRUN, SUCCESSFUL, FAILED
};
private Status status;
public CodeGenStatus(Status status) {
this.status = status;
}
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
} }

View File

@ -456,7 +456,7 @@
</repository> </repository>
</repositories> </repositories>
<properties> <properties>
<swagger-parser-version>1.0.9-SNAPSHOT</swagger-parser-version> <swagger-parser-version>1.0.9</swagger-parser-version>
<scala-version>2.11.1</scala-version> <scala-version>2.11.1</scala-version>
<felix-version>2.3.4</felix-version> <felix-version>2.3.4</felix-version>
<swagger-core-version>1.5.0</swagger-core-version> <swagger-core-version>1.5.0</swagger-core-version>