[Java Play Framework] Remove most warnings + bug fixes (#6275)

* Removals of most of the warnings found by lint

* Removals of most of the warnings found by lint (PART 2)

* Removals of most of the warnings found by lint (PART 3)

* Removals of most of the warnings found by lint (PART 4)

* Removals of most of the warnings found by lint (PART 5)

* Fix conversion error

* Removal of unnecessary import. Other will need more complex login in the generator itself (not in the mustache files)

* Add missing imports + fix to the regex. Generation of the samples
This commit is contained in:
Jean-François Côté 2017-08-11 03:38:18 -04:00 committed by wing328
parent b0333af8bd
commit ab28c7c825
140 changed files with 849 additions and 874 deletions

View File

@ -638,19 +638,39 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
if (ap.getItems() == null) {
return null;
}
return String.format(pattern, getTypeDeclaration(ap.getItems()));
String typeDeclaration = getTypeDeclaration(ap.getItems());
Object java8obj = additionalProperties.get("java8");
if (java8obj != null) {
Boolean java8 = Boolean.valueOf(java8obj.toString());
if (java8 != null && java8) {
typeDeclaration = "";
}
}
return String.format(pattern, typeDeclaration);
} else if (p instanceof MapProperty) {
final MapProperty ap = (MapProperty) p;
final String pattern;
if (fullJavaUtil) {
pattern = "new java.util.HashMap<String, %s>()";
pattern = "new java.util.HashMap<%s>()";
} else {
pattern = "new HashMap<String, %s>()";
pattern = "new HashMap<%s>()";
}
if (ap.getAdditionalProperties() == null) {
return null;
}
return String.format(pattern, getTypeDeclaration(ap.getAdditionalProperties()));
String typeDeclaration = String.format("String, %s", getTypeDeclaration(ap.getAdditionalProperties()));
Object java8obj = additionalProperties.get("java8");
if (java8obj != null) {
Boolean java8 = Boolean.valueOf(java8obj.toString());
if (java8 != null && java8) {
typeDeclaration = "";
}
}
return String.format(pattern, typeDeclaration);
} else if (p instanceof IntegerProperty) {
IntegerProperty dp = (IntegerProperty) p;
if (dp.getDefault() != null) {

View File

@ -51,7 +51,7 @@ public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements Bea
additionalProperties.put(CONFIG_PACKAGE, configPackage);
additionalProperties.put(BASE_PACKAGE, basePackage);
additionalProperties.put("java8", true);
additionalProperties.put("jackson", "true");
cliOptions.add(new CliOption(TITLE, "server title name or client service name"));
@ -263,7 +263,7 @@ public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements Bea
}
}
Pattern pathVariableMatcher = Pattern.compile("\\{(.+)}");
Pattern pathVariableMatcher = Pattern.compile("\\{([^}]+)}");
Matcher match = pathVariableMatcher.matcher(operation.path);
while (match.find()) {
String completeMatch = match.group();

View File

@ -1 +1 @@
{{#isBoolean}}Boolean.valueOf({{/isBoolean}}{{#isInteger}}Integer.parseInt({{/isInteger}}{{#isDouble}}Double.parseDouble({{/isDouble}}{{#isLong}}Long.parseLong({{/isLong}}{{#isFloat}}Float.parseFloat({{/isFloat}}{{#isString}}(String){{/isString}}{{#isDateTime}}OffsetDateTime.parse({{/isDateTime}}
{{#isBoolean}}Boolean.valueOf({{/isBoolean}}{{#isInteger}}Integer.parseInt({{/isInteger}}{{#isDouble}}Double.parseDouble({{/isDouble}}{{#isLong}}Long.parseLong({{/isLong}}{{#isFloat}}Float.parseFloat({{/isFloat}}{{#isDateTime}}OffsetDateTime.parse({{/isDateTime}}

View File

@ -1 +1 @@
{{#isBoolean}}){{/isBoolean}}{{#isInteger}}){{/isInteger}}{{#isDouble}}){{/isDouble}}{{#isLong}}){{/isLong}}{{#isFloat}}){{/isFloat}}{{#isString}}{{/isString}}{{#isDateTime}}){{/isDateTime}}
{{#isBoolean}}){{/isBoolean}}{{#isInteger}}){{/isInteger}}{{#isDouble}}){{/isDouble}}{{#isLong}}){{/isLong}}{{#isFloat}}){{/isFloat}}{{#isDateTime}}){{/isDateTime}}

View File

@ -20,7 +20,7 @@
{{/allowableValues}}
{{/gson}}
private {{{datatype}}} value;
private final {{{datatype}}} value;
{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{datatype}}} value) {
this.value = value;

View File

@ -18,7 +18,7 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum
{{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}}
{{/gson}}
private {{{dataType}}} value;
private final {{{dataType}}} value;
{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) {
this.value = value;

View File

@ -1,17 +1,13 @@
package {{package}};
import java.util.Objects;
{{#imports}}import {{import}};
{{/imports}}
{{#serializableModel}}
import java.io.Serializable;
{{/serializableModel}}
import com.fasterxml.jackson.annotation.*;
{{#useBeanValidation}}
import java.util.Set;
import javax.validation.*;
import javax.validation.constraints.*;
{{/useBeanValidation}}
{{#models}}
{{#model}}
{{#isEnum}}

View File

@ -12,7 +12,10 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.File;
{{^handleExceptions}}
import java.io.IOException;
{{/handleExceptions}}
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -90,7 +93,8 @@ public class {{classname}}Controller extends Controller {
{{#formParams}}
{{^notFile}}
{{{dataType}}} {{paramName}} = request().body().asMultipartFormData().getFile("{{baseName}}");
{{#required}}if (({{paramName}} == null || ((File) {{paramName}}.getFile()).length() == 0)) {
{{#required}}
if (({{paramName}} == null || ((File) {{paramName}}.getFile()).length() == 0)) {
throw new RuntimeException("File cannot be empty");
}
{{/required}}
@ -148,10 +152,21 @@ public class {{classname}}Controller extends Controller {
entry.getValue().validate();
}
{{/isMapContainer}}{{^returnContainer}}obj.validate();{{/returnContainer}}{{/useBeanValidation}}{{/returnTypeIsPrimitive}}{{/isResponseFile}}{{/returnType}}
{{#returnType}}{{^isResponseFile}}JsonNode result = mapper.valueToTree(obj);
return ok(result);{{/isResponseFile}}{{#isResponseFile}}return ok(obj);{{/isResponseFile}}{{/returnType}}
{{^returnType}}return ok();{{/returnType}}{{/controllerOnly}}
{{#controllerOnly}}return ok();{{/controllerOnly}}
{{#returnType}}
{{^isResponseFile}}JsonNode result = mapper.valueToTree(obj);
return ok(result);
{{/isResponseFile}}
{{#isResponseFile}}
return ok(obj);
{{/isResponseFile}}
{{/returnType}}
{{^returnType}}
return ok();
{{/returnType}}
{{/controllerOnly}}
{{#controllerOnly}}
return ok();
{{/controllerOnly}}
}
{{/operation}}
}

View File

@ -13,6 +13,7 @@ import javax.validation.constraints.*;
{{/useBeanValidation}}
{{#operations}}
@SuppressWarnings("RedundantThrows")
public interface {{classname}}ControllerImpInterface {
{{#operation}}
{{>returnTypes}} {{operationId}}({{#allParams}}{{>pathParams}}{{>queryParams}}{{>bodyParams}}{{>formParams}}{{>headerParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {{#handleExceptions}}throws Exception{{/handleExceptions}};

View File

@ -1,7 +1,12 @@
import java.util.Objects;
{{#useBeanValidation}}
import javax.validation.constraints.*;
{{/useBeanValidation}}
/**
* {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
*/
{{>generatedAnnotation}}
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} {
{{#vars}}
{{#isEnum}}
@ -39,11 +44,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) {
{{^required}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
if ({{name}} == null) {
{{name}} = {{{defaultValue}}};
}
{{/required}}
this.{{name}}.add({{name}}Item);
{{name}}.add({{name}}Item);
return this;
}
{{/isListContainer}}
@ -97,7 +102,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
return false;
}{{#hasVars}}
{{classname}} {{classVarName}} = ({{classname}}) o;
return {{#vars}}Objects.equals(this.{{name}}, {{classVarName}}.{{name}}){{#hasMore}} &&
return {{#vars}}Objects.equals({{name}}, {{classVarName}}.{{name}}){{#hasMore}} &&
{{/hasMore}}{{/vars}}{{#parent}} &&
super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}}
return true;{{/hasVars}}
@ -108,6 +113,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
return Objects.hash({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}});
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* A category for a pet
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Category {
@JsonProperty("id")
private Long id = null;
@ -60,8 +61,8 @@ public class Category {
return false;
}
Category category = (Category) o;
return Objects.equals(this.id, category.id) &&
Objects.equals(this.name, category.name);
return Objects.equals(id, category.id) &&
Objects.equals(name, category.name);
}
@Override
@ -69,6 +70,7 @@ public class Category {
return Objects.hash(id, name);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Describes the result of uploading an image resource
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class ModelApiResponse {
@JsonProperty("code")
private Integer code = null;
@ -80,9 +81,9 @@ public class ModelApiResponse {
return false;
}
ModelApiResponse _apiResponse = (ModelApiResponse) o;
return Objects.equals(this.code, _apiResponse.code) &&
Objects.equals(this.type, _apiResponse.type) &&
Objects.equals(this.message, _apiResponse.message);
return Objects.equals(code, _apiResponse.code) &&
Objects.equals(type, _apiResponse.type) &&
Objects.equals(message, _apiResponse.message);
}
@Override
@ -90,6 +91,7 @@ public class ModelApiResponse {
return Objects.hash(code, type, message);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,15 +1,16 @@
package apimodels;
import java.util.Objects;
import java.time.OffsetDateTime;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* An order for a pets from the pet store
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Order {
@JsonProperty("id")
private Long id = null;
@ -33,7 +34,7 @@ public class Order {
DELIVERED("delivered");
private String value;
private final String value;
StatusEnum(String value) {
this.value = value;
@ -175,12 +176,12 @@ public class Order {
return false;
}
Order order = (Order) o;
return Objects.equals(this.id, order.id) &&
Objects.equals(this.petId, order.petId) &&
Objects.equals(this.quantity, order.quantity) &&
Objects.equals(this.shipDate, order.shipDate) &&
Objects.equals(this.status, order.status) &&
Objects.equals(this.complete, order.complete);
return Objects.equals(id, order.id) &&
Objects.equals(petId, order.petId) &&
Objects.equals(quantity, order.quantity) &&
Objects.equals(shipDate, order.shipDate) &&
Objects.equals(status, order.status) &&
Objects.equals(complete, order.complete);
}
@Override
@ -188,6 +189,7 @@ public class Order {
return Objects.hash(id, petId, quantity, shipDate, status, complete);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,6 +1,5 @@
package apimodels;
import java.util.Objects;
import apimodels.Category;
import apimodels.Tag;
import java.util.ArrayList;
@ -8,11 +7,13 @@ import java.util.List;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* A pet for sale in the pet store
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Pet {
@JsonProperty("id")
private Long id = null;
@ -24,7 +25,7 @@ public class Pet {
private String name = null;
@JsonProperty("photoUrls")
private List<String> photoUrls = new ArrayList<String>();
private List<String> photoUrls = new ArrayList<>();
@JsonProperty("tags")
private List<Tag> tags = null;
@ -39,7 +40,7 @@ public class Pet {
SOLD("sold");
private String value;
private final String value;
StatusEnum(String value) {
this.value = value;
@ -124,7 +125,7 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
this.photoUrls.add(photoUrlsItem);
photoUrls.add(photoUrlsItem);
return this;
}
@ -147,10 +148,10 @@ public class Pet {
}
public Pet addTagsItem(Tag tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<Tag>();
if (tags == null) {
tags = new ArrayList<>();
}
this.tags.add(tagsItem);
tags.add(tagsItem);
return this;
}
@ -194,12 +195,12 @@ public class Pet {
return false;
}
Pet pet = (Pet) o;
return Objects.equals(this.id, pet.id) &&
Objects.equals(this.category, pet.category) &&
Objects.equals(this.name, pet.name) &&
Objects.equals(this.photoUrls, pet.photoUrls) &&
Objects.equals(this.tags, pet.tags) &&
Objects.equals(this.status, pet.status);
return Objects.equals(id, pet.id) &&
Objects.equals(category, pet.category) &&
Objects.equals(name, pet.name) &&
Objects.equals(photoUrls, pet.photoUrls) &&
Objects.equals(tags, pet.tags) &&
Objects.equals(status, pet.status);
}
@Override
@ -207,6 +208,7 @@ public class Pet {
return Objects.hash(id, category, name, photoUrls, tags, status);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* A tag for a pet
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Tag {
@JsonProperty("id")
private Long id = null;
@ -60,8 +61,8 @@ public class Tag {
return false;
}
Tag tag = (Tag) o;
return Objects.equals(this.id, tag.id) &&
Objects.equals(this.name, tag.name);
return Objects.equals(id, tag.id) &&
Objects.equals(name, tag.name);
}
@Override
@ -69,6 +70,7 @@ public class Tag {
return Objects.hash(id, name);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* A User who is purchasing from the pet store
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class User {
@JsonProperty("id")
private Long id = null;
@ -180,14 +181,14 @@ public class User {
return false;
}
User user = (User) o;
return Objects.equals(this.id, user.id) &&
Objects.equals(this.username, user.username) &&
Objects.equals(this.firstName, user.firstName) &&
Objects.equals(this.lastName, user.lastName) &&
Objects.equals(this.email, user.email) &&
Objects.equals(this.password, user.password) &&
Objects.equals(this.phone, user.phone) &&
Objects.equals(this.userStatus, user.userStatus);
return Objects.equals(id, user.id) &&
Objects.equals(username, user.username) &&
Objects.equals(firstName, user.firstName) &&
Objects.equals(lastName, user.lastName) &&
Objects.equals(email, user.email) &&
Objects.equals(password, user.password) &&
Objects.equals(phone, user.phone) &&
Objects.equals(userStatus, user.userStatus);
}
@Override
@ -195,6 +196,7 @@ public class User {
return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -13,7 +13,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.IOException;
import java.io.File;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -40,7 +40,6 @@ public class PetApiController extends Controller {
body = mapper.readValue(nodebody.toString(), Pet.class);
body.validate();
return ok();
}
@ -49,12 +48,11 @@ public class PetApiController extends Controller {
String valueapiKey = request().getHeader("api_key");
String apiKey;
if (valueapiKey != null) {
apiKey = (String)valueapiKey;
apiKey = valueapiKey;
} else {
apiKey = null;
}
return ok();
}
@ -66,7 +64,6 @@ public class PetApiController extends Controller {
//noinspection UseBulkOperation
status.add(curParam);
}
return ok();
}
@ -78,13 +75,11 @@ public class PetApiController extends Controller {
//noinspection UseBulkOperation
tags.add(curParam);
}
return ok();
}
@ApiAction
public Result getPetById(Long petId) throws Exception {
return ok();
}
@ -96,7 +91,6 @@ public class PetApiController extends Controller {
body = mapper.readValue(nodebody.toString(), Pet.class);
body.validate();
return ok();
}
@ -105,7 +99,7 @@ public class PetApiController extends Controller {
String valuename = (request().body().asMultipartFormData().asFormUrlEncoded().get("name"))[0];
String name;
if (valuename != null) {
name = (String)valuename;
name = valuename;
} else {
name = null;
@ -113,12 +107,11 @@ public class PetApiController extends Controller {
String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0];
String status;
if (valuestatus != null) {
status = (String)valuestatus;
status = valuestatus;
} else {
status = null;
}
return ok();
}
@ -127,13 +120,12 @@ public class PetApiController extends Controller {
String valueadditionalMetadata = (request().body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata"))[0];
String additionalMetadata;
if (valueadditionalMetadata != null) {
additionalMetadata = (String)valueadditionalMetadata;
additionalMetadata = valueadditionalMetadata;
} else {
additionalMetadata = null;
}
Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file");
return ok();
}
}

View File

@ -12,7 +12,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.IOException;
import java.io.File;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -33,19 +33,16 @@ public class StoreApiController extends Controller {
@ApiAction
public Result deleteOrder(String orderId) throws Exception {
return ok();
}
@ApiAction
public Result getInventory() throws Exception {
return ok();
}
@ApiAction
public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception {
return ok();
}
@ -57,7 +54,6 @@ public class StoreApiController extends Controller {
body = mapper.readValue(nodebody.toString(), Order.class);
body.validate();
return ok();
}
}

View File

@ -12,7 +12,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.IOException;
import java.io.File;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -39,7 +39,6 @@ public class UserApiController extends Controller {
body = mapper.readValue(nodebody.toString(), User.class);
body.validate();
return ok();
}
@ -53,7 +52,6 @@ public class UserApiController extends Controller {
curItem.validate();
}
return ok();
}
@ -67,19 +65,16 @@ public class UserApiController extends Controller {
curItem.validate();
}
return ok();
}
@ApiAction
public Result deleteUser(String username) throws Exception {
return ok();
}
@ApiAction
public Result getUserByName(String username) throws Exception {
return ok();
}
@ -88,20 +83,18 @@ public class UserApiController extends Controller {
String valueusername = request().getQueryString("username");
String username;
username = (String)valueusername;
username = valueusername;
String valuepassword = request().getQueryString("password");
String password;
password = (String)valuepassword;
password = valuepassword;
return ok();
}
@ApiAction
public Result logoutUser() throws Exception {
return ok();
}
@ -113,7 +106,6 @@ public class UserApiController extends Controller {
body = mapper.readValue(nodebody.toString(), User.class);
body.validate();
return ok();
}
}

View File

@ -1 +0,0 @@
2017-08-08 12:56:15,882 [INFO] from play.api.Play in ForkJoinPool-1-worker-1 - Application started (Dev)

View File

@ -1,17 +1,18 @@
package apimodels;
import java.util.Objects;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* AdditionalPropertiesClass
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class AdditionalPropertiesClass {
@JsonProperty("map_property")
private Map<String, String> mapProperty = null;
@ -26,7 +27,7 @@ public class AdditionalPropertiesClass {
public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) {
if (this.mapProperty == null) {
this.mapProperty = new HashMap<String, String>();
this.mapProperty = new HashMap<>();
}
this.mapProperty.put(key, mapPropertyItem);
return this;
@ -51,7 +52,7 @@ public class AdditionalPropertiesClass {
public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map<String, String> mapOfMapPropertyItem) {
if (this.mapOfMapProperty == null) {
this.mapOfMapProperty = new HashMap<String, Map<String, String>>();
this.mapOfMapProperty = new HashMap<>();
}
this.mapOfMapProperty.put(key, mapOfMapPropertyItem);
return this;
@ -80,8 +81,8 @@ public class AdditionalPropertiesClass {
return false;
}
AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o;
return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) &&
Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty);
return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) &&
Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty);
}
@Override
@ -89,6 +90,7 @@ public class AdditionalPropertiesClass {
return Objects.hash(mapProperty, mapOfMapProperty);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,16 +1,17 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Animal
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Animal {
@JsonProperty("className")
private String className = null;
@ -63,8 +64,8 @@ public class Animal {
return false;
}
Animal animal = (Animal) o;
return Objects.equals(this.className, animal.className) &&
Objects.equals(this.color, animal.color);
return Objects.equals(className, animal.className) &&
Objects.equals(color, animal.color);
}
@Override
@ -72,6 +73,7 @@ public class Animal {
return Objects.hash(className, color);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,17 +1,18 @@
package apimodels;
import java.util.Objects;
import apimodels.Animal;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* AnimalFarm
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class AnimalFarm extends ArrayList<Animal> {
@Override
@ -30,6 +31,7 @@ public class AnimalFarm extends ArrayList<Animal> {
return Objects.hash(super.hashCode());
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,17 +1,18 @@
package apimodels;
import java.util.Objects;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* ArrayOfArrayOfNumberOnly
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class ArrayOfArrayOfNumberOnly {
@JsonProperty("ArrayArrayNumber")
private List<List<BigDecimal>> arrayArrayNumber = null;
@ -22,10 +23,10 @@ public class ArrayOfArrayOfNumberOnly {
}
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
if (this.arrayArrayNumber == null) {
this.arrayArrayNumber = new ArrayList<List<BigDecimal>>();
if (arrayArrayNumber == null) {
arrayArrayNumber = new ArrayList<>();
}
this.arrayArrayNumber.add(arrayArrayNumberItem);
arrayArrayNumber.add(arrayArrayNumberItem);
return this;
}
@ -52,7 +53,7 @@ public class ArrayOfArrayOfNumberOnly {
return false;
}
ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o;
return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber);
return Objects.equals(arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber);
}
@Override
@ -60,6 +61,7 @@ public class ArrayOfArrayOfNumberOnly {
return Objects.hash(arrayArrayNumber);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,17 +1,18 @@
package apimodels;
import java.util.Objects;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* ArrayOfNumberOnly
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class ArrayOfNumberOnly {
@JsonProperty("ArrayNumber")
private List<BigDecimal> arrayNumber = null;
@ -22,10 +23,10 @@ public class ArrayOfNumberOnly {
}
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
if (this.arrayNumber == null) {
this.arrayNumber = new ArrayList<BigDecimal>();
if (arrayNumber == null) {
arrayNumber = new ArrayList<>();
}
this.arrayNumber.add(arrayNumberItem);
arrayNumber.add(arrayNumberItem);
return this;
}
@ -52,7 +53,7 @@ public class ArrayOfNumberOnly {
return false;
}
ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o;
return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber);
return Objects.equals(arrayNumber, arrayOfNumberOnly.arrayNumber);
}
@Override
@ -60,6 +61,7 @@ public class ArrayOfNumberOnly {
return Objects.hash(arrayNumber);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,17 +1,18 @@
package apimodels;
import java.util.Objects;
import apimodels.ReadOnlyFirst;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* ArrayTest
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class ArrayTest {
@JsonProperty("array_of_string")
private List<String> arrayOfString = null;
@ -28,10 +29,10 @@ public class ArrayTest {
}
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
if (this.arrayOfString == null) {
this.arrayOfString = new ArrayList<String>();
if (arrayOfString == null) {
arrayOfString = new ArrayList<>();
}
this.arrayOfString.add(arrayOfStringItem);
arrayOfString.add(arrayOfStringItem);
return this;
}
@ -53,10 +54,10 @@ public class ArrayTest {
}
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
if (this.arrayArrayOfInteger == null) {
this.arrayArrayOfInteger = new ArrayList<List<Long>>();
if (arrayArrayOfInteger == null) {
arrayArrayOfInteger = new ArrayList<>();
}
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
return this;
}
@ -79,10 +80,10 @@ public class ArrayTest {
}
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
if (this.arrayArrayOfModel == null) {
this.arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
if (arrayArrayOfModel == null) {
arrayArrayOfModel = new ArrayList<>();
}
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
arrayArrayOfModel.add(arrayArrayOfModelItem);
return this;
}
@ -109,9 +110,9 @@ public class ArrayTest {
return false;
}
ArrayTest arrayTest = (ArrayTest) o;
return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) &&
Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) &&
Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel);
return Objects.equals(arrayOfString, arrayTest.arrayOfString) &&
Objects.equals(arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) &&
Objects.equals(arrayArrayOfModel, arrayTest.arrayArrayOfModel);
}
@Override
@ -119,6 +120,7 @@ public class ArrayTest {
return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Capitalization
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Capitalization {
@JsonProperty("smallCamel")
private String smallCamel = null;
@ -140,12 +141,12 @@ public class Capitalization {
return false;
}
Capitalization capitalization = (Capitalization) o;
return Objects.equals(this.smallCamel, capitalization.smallCamel) &&
Objects.equals(this.capitalCamel, capitalization.capitalCamel) &&
Objects.equals(this.smallSnake, capitalization.smallSnake) &&
Objects.equals(this.capitalSnake, capitalization.capitalSnake) &&
Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) &&
Objects.equals(this.ATT_NAME, capitalization.ATT_NAME);
return Objects.equals(smallCamel, capitalization.smallCamel) &&
Objects.equals(capitalCamel, capitalization.capitalCamel) &&
Objects.equals(smallSnake, capitalization.smallSnake) &&
Objects.equals(capitalSnake, capitalization.capitalSnake) &&
Objects.equals(scAETHFlowPoints, capitalization.scAETHFlowPoints) &&
Objects.equals(ATT_NAME, capitalization.ATT_NAME);
}
@Override
@ -153,6 +154,7 @@ public class Capitalization {
return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,15 +1,16 @@
package apimodels;
import java.util.Objects;
import apimodels.Animal;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Cat
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Cat extends Animal {
@JsonProperty("declawed")
private Boolean declawed = null;
@ -41,7 +42,7 @@ public class Cat extends Animal {
return false;
}
Cat cat = (Cat) o;
return Objects.equals(this.declawed, cat.declawed) &&
return Objects.equals(declawed, cat.declawed) &&
super.equals(o);
}
@ -50,6 +51,7 @@ public class Cat extends Animal {
return Objects.hash(declawed, super.hashCode());
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Category
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Category {
@JsonProperty("id")
private Long id = null;
@ -60,8 +61,8 @@ public class Category {
return false;
}
Category category = (Category) o;
return Objects.equals(this.id, category.id) &&
Objects.equals(this.name, category.name);
return Objects.equals(id, category.id) &&
Objects.equals(name, category.name);
}
@Override
@ -69,6 +70,7 @@ public class Category {
return Objects.hash(id, name);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Model for testing model with \&quot;_class\&quot; property
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class ClassModel {
@JsonProperty("_class")
private String propertyClass = null;
@ -40,7 +41,7 @@ public class ClassModel {
return false;
}
ClassModel classModel = (ClassModel) o;
return Objects.equals(this.propertyClass, classModel.propertyClass);
return Objects.equals(propertyClass, classModel.propertyClass);
}
@Override
@ -48,6 +49,7 @@ public class ClassModel {
return Objects.hash(propertyClass);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Client
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Client {
@JsonProperty("client")
private String client = null;
@ -40,7 +41,7 @@ public class Client {
return false;
}
Client client = (Client) o;
return Objects.equals(this.client, client.client);
return Objects.equals(client, client.client);
}
@Override
@ -48,6 +49,7 @@ public class Client {
return Objects.hash(client);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,15 +1,16 @@
package apimodels;
import java.util.Objects;
import apimodels.Animal;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Dog
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Dog extends Animal {
@JsonProperty("breed")
private String breed = null;
@ -41,7 +42,7 @@ public class Dog extends Animal {
return false;
}
Dog dog = (Dog) o;
return Objects.equals(this.breed, dog.breed) &&
return Objects.equals(breed, dog.breed) &&
super.equals(o);
}
@ -50,6 +51,7 @@ public class Dog extends Animal {
return Objects.hash(breed, super.hashCode());
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,16 +1,17 @@
package apimodels;
import java.util.Objects;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* EnumArrays
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class EnumArrays {
/**
* Gets or Sets justSymbol
@ -20,7 +21,7 @@ public class EnumArrays {
DOLLAR("$");
private String value;
private final String value;
JustSymbolEnum(String value) {
this.value = value;
@ -54,7 +55,7 @@ public class EnumArrays {
CRAB("crab");
private String value;
private final String value;
ArrayEnumEnum(String value) {
this.value = value;
@ -103,10 +104,10 @@ public class EnumArrays {
}
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
if (this.arrayEnum == null) {
this.arrayEnum = new ArrayList<ArrayEnumEnum>();
if (arrayEnum == null) {
arrayEnum = new ArrayList<>();
}
this.arrayEnum.add(arrayEnumItem);
arrayEnum.add(arrayEnumItem);
return this;
}
@ -132,8 +133,8 @@ public class EnumArrays {
return false;
}
EnumArrays enumArrays = (EnumArrays) o;
return Objects.equals(this.justSymbol, enumArrays.justSymbol) &&
Objects.equals(this.arrayEnum, enumArrays.arrayEnum);
return Objects.equals(justSymbol, enumArrays.justSymbol) &&
Objects.equals(arrayEnum, enumArrays.arrayEnum);
}
@Override
@ -141,6 +142,7 @@ public class EnumArrays {
return Objects.hash(justSymbol, arrayEnum);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,10 +1,8 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonCreator;
/**
@ -18,7 +16,7 @@ public enum EnumClass {
_XYZ_("(xyz)");
private String value;
private final String value;
EnumClass(String value) {
this.value = value;

View File

@ -1,15 +1,16 @@
package apimodels;
import java.util.Objects;
import apimodels.OuterEnum;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* EnumTest
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class EnumTest {
/**
* Gets or Sets enumString
@ -21,7 +22,7 @@ public class EnumTest {
EMPTY("");
private String value;
private final String value;
EnumStringEnum(String value) {
this.value = value;
@ -55,7 +56,7 @@ public class EnumTest {
NUMBER_MINUS_1(-1);
private Integer value;
private final Integer value;
EnumIntegerEnum(Integer value) {
this.value = value;
@ -89,7 +90,7 @@ public class EnumTest {
NUMBER_MINUS_1_DOT_2(-1.2);
private Double value;
private final Double value;
EnumNumberEnum(Double value) {
this.value = value;
@ -197,10 +198,10 @@ public class EnumTest {
return false;
}
EnumTest enumTest = (EnumTest) o;
return Objects.equals(this.enumString, enumTest.enumString) &&
Objects.equals(this.enumInteger, enumTest.enumInteger) &&
Objects.equals(this.enumNumber, enumTest.enumNumber) &&
Objects.equals(this.outerEnum, enumTest.outerEnum);
return Objects.equals(enumString, enumTest.enumString) &&
Objects.equals(enumInteger, enumTest.enumInteger) &&
Objects.equals(enumNumber, enumTest.enumNumber) &&
Objects.equals(outerEnum, enumTest.outerEnum);
}
@Override
@ -208,6 +209,7 @@ public class EnumTest {
return Objects.hash(enumString, enumInteger, enumNumber, outerEnum);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,6 +1,5 @@
package apimodels;
import java.util.Objects;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.OffsetDateTime;
@ -8,11 +7,13 @@ import java.util.UUID;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* FormatTest
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class FormatTest {
@JsonProperty("integer")
private Integer integer = null;
@ -315,19 +316,19 @@ public class FormatTest {
return false;
}
FormatTest formatTest = (FormatTest) o;
return Objects.equals(this.integer, formatTest.integer) &&
Objects.equals(this.int32, formatTest.int32) &&
Objects.equals(this.int64, formatTest.int64) &&
Objects.equals(this.number, formatTest.number) &&
Objects.equals(this._float, formatTest._float) &&
Objects.equals(this._double, formatTest._double) &&
Objects.equals(this.string, formatTest.string) &&
Objects.equals(this._byte, formatTest._byte) &&
Objects.equals(this.binary, formatTest.binary) &&
Objects.equals(this.date, formatTest.date) &&
Objects.equals(this.dateTime, formatTest.dateTime) &&
Objects.equals(this.uuid, formatTest.uuid) &&
Objects.equals(this.password, formatTest.password);
return Objects.equals(integer, formatTest.integer) &&
Objects.equals(int32, formatTest.int32) &&
Objects.equals(int64, formatTest.int64) &&
Objects.equals(number, formatTest.number) &&
Objects.equals(_float, formatTest._float) &&
Objects.equals(_double, formatTest._double) &&
Objects.equals(string, formatTest.string) &&
Objects.equals(_byte, formatTest._byte) &&
Objects.equals(binary, formatTest.binary) &&
Objects.equals(date, formatTest.date) &&
Objects.equals(dateTime, formatTest.dateTime) &&
Objects.equals(uuid, formatTest.uuid) &&
Objects.equals(password, formatTest.password);
}
@Override
@ -335,6 +336,7 @@ public class FormatTest {
return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* HasOnlyReadOnly
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class HasOnlyReadOnly {
@JsonProperty("bar")
private String bar = null;
@ -60,8 +61,8 @@ public class HasOnlyReadOnly {
return false;
}
HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o;
return Objects.equals(this.bar, hasOnlyReadOnly.bar) &&
Objects.equals(this.foo, hasOnlyReadOnly.foo);
return Objects.equals(bar, hasOnlyReadOnly.bar) &&
Objects.equals(foo, hasOnlyReadOnly.foo);
}
@Override
@ -69,6 +70,7 @@ public class HasOnlyReadOnly {
return Objects.hash(bar, foo);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,17 +1,18 @@
package apimodels;
import java.util.Objects;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* MapTest
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class MapTest {
@JsonProperty("map_map_of_string")
private Map<String, Map<String, String>> mapMapOfString = null;
@ -24,7 +25,7 @@ public class MapTest {
LOWER("lower");
private String value;
private final String value;
InnerEnum(String value) {
this.value = value;
@ -57,7 +58,7 @@ public class MapTest {
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
if (this.mapMapOfString == null) {
this.mapMapOfString = new HashMap<String, Map<String, String>>();
this.mapMapOfString = new HashMap<>();
}
this.mapMapOfString.put(key, mapMapOfStringItem);
return this;
@ -83,7 +84,7 @@ public class MapTest {
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
if (this.mapOfEnumString == null) {
this.mapOfEnumString = new HashMap<String, InnerEnum>();
this.mapOfEnumString = new HashMap<>();
}
this.mapOfEnumString.put(key, mapOfEnumStringItem);
return this;
@ -111,8 +112,8 @@ public class MapTest {
return false;
}
MapTest mapTest = (MapTest) o;
return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
return Objects.equals(mapMapOfString, mapTest.mapMapOfString) &&
Objects.equals(mapOfEnumString, mapTest.mapOfEnumString);
}
@Override
@ -120,6 +121,7 @@ public class MapTest {
return Objects.hash(mapMapOfString, mapOfEnumString);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,6 +1,5 @@
package apimodels;
import java.util.Objects;
import apimodels.Animal;
import java.time.OffsetDateTime;
import java.util.HashMap;
@ -10,11 +9,13 @@ import java.util.UUID;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* MixedPropertiesAndAdditionalPropertiesClass
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class MixedPropertiesAndAdditionalPropertiesClass {
@JsonProperty("uuid")
private UUID uuid = null;
@ -68,7 +69,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
if (this.map == null) {
this.map = new HashMap<String, Animal>();
this.map = new HashMap<>();
}
this.map.put(key, mapItem);
return this;
@ -97,9 +98,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
return false;
}
MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o;
return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) &&
Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) &&
Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map);
return Objects.equals(uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) &&
Objects.equals(dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) &&
Objects.equals(map, mixedPropertiesAndAdditionalPropertiesClass.map);
}
@Override
@ -107,6 +108,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
return Objects.hash(uuid, dateTime, map);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Model for testing model name starting with number
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Model200Response {
@JsonProperty("name")
private Integer name = null;
@ -60,8 +61,8 @@ public class Model200Response {
return false;
}
Model200Response _200Response = (Model200Response) o;
return Objects.equals(this.name, _200Response.name) &&
Objects.equals(this.propertyClass, _200Response.propertyClass);
return Objects.equals(name, _200Response.name) &&
Objects.equals(propertyClass, _200Response.propertyClass);
}
@Override
@ -69,6 +70,7 @@ public class Model200Response {
return Objects.hash(name, propertyClass);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* ModelApiResponse
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class ModelApiResponse {
@JsonProperty("code")
private Integer code = null;
@ -80,9 +81,9 @@ public class ModelApiResponse {
return false;
}
ModelApiResponse _apiResponse = (ModelApiResponse) o;
return Objects.equals(this.code, _apiResponse.code) &&
Objects.equals(this.type, _apiResponse.type) &&
Objects.equals(this.message, _apiResponse.message);
return Objects.equals(code, _apiResponse.code) &&
Objects.equals(type, _apiResponse.type) &&
Objects.equals(message, _apiResponse.message);
}
@Override
@ -90,6 +91,7 @@ public class ModelApiResponse {
return Objects.hash(code, type, message);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Model for testing reserved words
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class ModelReturn {
@JsonProperty("return")
private Integer _return = null;
@ -40,7 +41,7 @@ public class ModelReturn {
return false;
}
ModelReturn _return = (ModelReturn) o;
return Objects.equals(this._return, _return._return);
return Objects.equals(_return, _return._return);
}
@Override
@ -48,6 +49,7 @@ public class ModelReturn {
return Objects.hash(_return);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Model for testing model name same as property name
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Name {
@JsonProperty("name")
private Integer name = null;
@ -101,10 +102,10 @@ public class Name {
return false;
}
Name name = (Name) o;
return Objects.equals(this.name, name.name) &&
Objects.equals(this.snakeCase, name.snakeCase) &&
Objects.equals(this.property, name.property) &&
Objects.equals(this._123Number, name._123Number);
return Objects.equals(name, name.name) &&
Objects.equals(snakeCase, name.snakeCase) &&
Objects.equals(property, name.property) &&
Objects.equals(_123Number, name._123Number);
}
@Override
@ -112,6 +113,7 @@ public class Name {
return Objects.hash(name, snakeCase, property, _123Number);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,15 +1,16 @@
package apimodels;
import java.util.Objects;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* NumberOnly
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class NumberOnly {
@JsonProperty("JustNumber")
private BigDecimal justNumber = null;
@ -42,7 +43,7 @@ public class NumberOnly {
return false;
}
NumberOnly numberOnly = (NumberOnly) o;
return Objects.equals(this.justNumber, numberOnly.justNumber);
return Objects.equals(justNumber, numberOnly.justNumber);
}
@Override
@ -50,6 +51,7 @@ public class NumberOnly {
return Objects.hash(justNumber);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,15 +1,16 @@
package apimodels;
import java.util.Objects;
import java.time.OffsetDateTime;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Order
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Order {
@JsonProperty("id")
private Long id = null;
@ -33,7 +34,7 @@ public class Order {
DELIVERED("delivered");
private String value;
private final String value;
StatusEnum(String value) {
this.value = value;
@ -175,12 +176,12 @@ public class Order {
return false;
}
Order order = (Order) o;
return Objects.equals(this.id, order.id) &&
Objects.equals(this.petId, order.petId) &&
Objects.equals(this.quantity, order.quantity) &&
Objects.equals(this.shipDate, order.shipDate) &&
Objects.equals(this.status, order.status) &&
Objects.equals(this.complete, order.complete);
return Objects.equals(id, order.id) &&
Objects.equals(petId, order.petId) &&
Objects.equals(quantity, order.quantity) &&
Objects.equals(shipDate, order.shipDate) &&
Objects.equals(status, order.status) &&
Objects.equals(complete, order.complete);
}
@Override
@ -188,6 +189,7 @@ public class Order {
return Objects.hash(id, petId, quantity, shipDate, status, complete);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,15 +1,16 @@
package apimodels;
import java.util.Objects;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* OuterComposite
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class OuterComposite {
@JsonProperty("my_number")
private BigDecimal myNumber = null;
@ -82,9 +83,9 @@ public class OuterComposite {
return false;
}
OuterComposite outerComposite = (OuterComposite) o;
return Objects.equals(this.myNumber, outerComposite.myNumber) &&
Objects.equals(this.myString, outerComposite.myString) &&
Objects.equals(this.myBoolean, outerComposite.myBoolean);
return Objects.equals(myNumber, outerComposite.myNumber) &&
Objects.equals(myString, outerComposite.myString) &&
Objects.equals(myBoolean, outerComposite.myBoolean);
}
@Override
@ -92,6 +93,7 @@ public class OuterComposite {
return Objects.hash(myNumber, myString, myBoolean);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,10 +1,8 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonCreator;
/**
@ -18,7 +16,7 @@ public enum OuterEnum {
DELIVERED("delivered");
private String value;
private final String value;
OuterEnum(String value) {
this.value = value;

View File

@ -1,6 +1,5 @@
package apimodels;
import java.util.Objects;
import apimodels.Category;
import apimodels.Tag;
import java.util.ArrayList;
@ -8,11 +7,13 @@ import java.util.List;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Pet
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Pet {
@JsonProperty("id")
private Long id = null;
@ -24,7 +25,7 @@ public class Pet {
private String name = null;
@JsonProperty("photoUrls")
private List<String> photoUrls = new ArrayList<String>();
private List<String> photoUrls = new ArrayList<>();
@JsonProperty("tags")
private List<Tag> tags = null;
@ -39,7 +40,7 @@ public class Pet {
SOLD("sold");
private String value;
private final String value;
StatusEnum(String value) {
this.value = value;
@ -124,7 +125,7 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
this.photoUrls.add(photoUrlsItem);
photoUrls.add(photoUrlsItem);
return this;
}
@ -147,10 +148,10 @@ public class Pet {
}
public Pet addTagsItem(Tag tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<Tag>();
if (tags == null) {
tags = new ArrayList<>();
}
this.tags.add(tagsItem);
tags.add(tagsItem);
return this;
}
@ -194,12 +195,12 @@ public class Pet {
return false;
}
Pet pet = (Pet) o;
return Objects.equals(this.id, pet.id) &&
Objects.equals(this.category, pet.category) &&
Objects.equals(this.name, pet.name) &&
Objects.equals(this.photoUrls, pet.photoUrls) &&
Objects.equals(this.tags, pet.tags) &&
Objects.equals(this.status, pet.status);
return Objects.equals(id, pet.id) &&
Objects.equals(category, pet.category) &&
Objects.equals(name, pet.name) &&
Objects.equals(photoUrls, pet.photoUrls) &&
Objects.equals(tags, pet.tags) &&
Objects.equals(status, pet.status);
}
@Override
@ -207,6 +208,7 @@ public class Pet {
return Objects.hash(id, category, name, photoUrls, tags, status);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* ReadOnlyFirst
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class ReadOnlyFirst {
@JsonProperty("bar")
private String bar = null;
@ -60,8 +61,8 @@ public class ReadOnlyFirst {
return false;
}
ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o;
return Objects.equals(this.bar, readOnlyFirst.bar) &&
Objects.equals(this.baz, readOnlyFirst.baz);
return Objects.equals(bar, readOnlyFirst.bar) &&
Objects.equals(baz, readOnlyFirst.baz);
}
@Override
@ -69,6 +70,7 @@ public class ReadOnlyFirst {
return Objects.hash(bar, baz);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* SpecialModelName
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class SpecialModelName {
@JsonProperty("$special[property.name]")
private Long specialPropertyName = null;
@ -40,7 +41,7 @@ public class SpecialModelName {
return false;
}
SpecialModelName specialModelName = (SpecialModelName) o;
return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName);
return Objects.equals(specialPropertyName, specialModelName.specialPropertyName);
}
@Override
@ -48,6 +49,7 @@ public class SpecialModelName {
return Objects.hash(specialPropertyName);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Tag
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Tag {
@JsonProperty("id")
private Long id = null;
@ -60,8 +61,8 @@ public class Tag {
return false;
}
Tag tag = (Tag) o;
return Objects.equals(this.id, tag.id) &&
Objects.equals(this.name, tag.name);
return Objects.equals(id, tag.id) &&
Objects.equals(name, tag.name);
}
@Override
@ -69,6 +70,7 @@ public class Tag {
return Objects.hash(id, name);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* User
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class User {
@JsonProperty("id")
private Long id = null;
@ -180,14 +181,14 @@ public class User {
return false;
}
User user = (User) o;
return Objects.equals(this.id, user.id) &&
Objects.equals(this.username, user.username) &&
Objects.equals(this.firstName, user.firstName) &&
Objects.equals(this.lastName, user.lastName) &&
Objects.equals(this.email, user.email) &&
Objects.equals(this.password, user.password) &&
Objects.equals(this.phone, user.phone) &&
Objects.equals(this.userStatus, user.userStatus);
return Objects.equals(id, user.id) &&
Objects.equals(username, user.username) &&
Objects.equals(firstName, user.firstName) &&
Objects.equals(lastName, user.lastName) &&
Objects.equals(email, user.email) &&
Objects.equals(password, user.password) &&
Objects.equals(phone, user.phone) &&
Objects.equals(userStatus, user.userStatus);
}
@Override
@ -195,6 +196,7 @@ public class User {
return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -15,7 +15,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.IOException;
import java.io.File;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -50,8 +50,6 @@ public class FakeApiController extends Controller {
Boolean obj = imp.fakeOuterBooleanSerialize(body);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -69,8 +67,6 @@ public class FakeApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -88,8 +84,6 @@ public class FakeApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -106,8 +100,6 @@ public class FakeApiController extends Controller {
String obj = imp.fakeOuterStringSerialize(body);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -122,8 +114,6 @@ public class FakeApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -173,7 +163,7 @@ public class FakeApiController extends Controller {
String valuestring = (request().body().asMultipartFormData().asFormUrlEncoded().get("string"))[0];
String string;
if (valuestring != null) {
string = (String)valuestring;
string = valuestring;
} else {
string = null;
@ -181,12 +171,12 @@ public class FakeApiController extends Controller {
String valuepatternWithoutDelimiter = (request().body().asMultipartFormData().asFormUrlEncoded().get("pattern_without_delimiter"))[0];
String patternWithoutDelimiter;
patternWithoutDelimiter = (String)valuepatternWithoutDelimiter;
patternWithoutDelimiter = valuepatternWithoutDelimiter;
String value_byte = (request().body().asMultipartFormData().asFormUrlEncoded().get("byte"))[0];
byte[] _byte;
_byte = (String)value_byte;
_byte = value_byte;
String valuebinary = (request().body().asMultipartFormData().asFormUrlEncoded().get("binary"))[0];
byte[] binary;
@ -215,7 +205,7 @@ public class FakeApiController extends Controller {
String valuepassword = (request().body().asMultipartFormData().asFormUrlEncoded().get("password"))[0];
String password;
if (valuepassword != null) {
password = (String)valuepassword;
password = valuepassword;
} else {
password = null;
@ -223,15 +213,13 @@ public class FakeApiController extends Controller {
String valueparamCallback = (request().body().asMultipartFormData().asFormUrlEncoded().get("callback"))[0];
String paramCallback;
if (valueparamCallback != null) {
paramCallback = (String)valueparamCallback;
paramCallback = valueparamCallback;
} else {
paramCallback = null;
}
imp.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
return ok();
}
@ApiAction
@ -245,7 +233,7 @@ public class FakeApiController extends Controller {
String valueenumQueryString = request().getQueryString("enumQueryString");
String enumQueryString;
if (valueenumQueryString != null) {
enumQueryString = (String)valueenumQueryString;
enumQueryString = valueenumQueryString;
} else {
enumQueryString = "-efg";
@ -267,7 +255,7 @@ public class FakeApiController extends Controller {
String valueenumFormString = (request().body().asMultipartFormData().asFormUrlEncoded().get("enum_form_string"))[0];
String enumFormString;
if (valueenumFormString != null) {
enumFormString = (String)valueenumFormString;
enumFormString = valueenumFormString;
} else {
enumFormString = "-efg";
@ -289,15 +277,13 @@ public class FakeApiController extends Controller {
String valueenumHeaderString = request().getHeader("enum_header_string");
String enumHeaderString;
if (valueenumHeaderString != null) {
enumHeaderString = (String)valueenumHeaderString;
enumHeaderString = valueenumHeaderString;
} else {
enumHeaderString = "-efg";
}
imp.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble);
return ok();
}
@ApiAction
@ -305,16 +291,14 @@ public class FakeApiController extends Controller {
String valueparam = (request().body().asMultipartFormData().asFormUrlEncoded().get("param"))[0];
String param;
param = (String)valueparam;
param = valueparam;
String valueparam2 = (request().body().asMultipartFormData().asFormUrlEncoded().get("param2"))[0];
String param2;
param2 = (String)valueparam2;
param2 = valueparam2;
imp.testJsonFormData(param, param2);
return ok();
}
}

View File

@ -13,6 +13,7 @@ import java.util.HashMap;
import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface FakeApiControllerImpInterface {
Boolean fakeOuterBooleanSerialize(Boolean body) throws Exception;

View File

@ -11,7 +11,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.IOException;
import java.io.File;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -44,7 +44,5 @@ public class FakeClassnameTags123ApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
}

View File

@ -9,6 +9,7 @@ import java.util.HashMap;
import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface FakeClassnameTags123ApiControllerImpInterface {
Client testClassname(Client body) throws Exception;

View File

@ -13,7 +13,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.IOException;
import java.io.File;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -43,9 +43,7 @@ public class PetApiController extends Controller {
body.validate();
imp.addPet(body);
return ok();
}
@ApiAction
@ -53,15 +51,13 @@ public class PetApiController extends Controller {
String valueapiKey = request().getHeader("api_key");
String apiKey;
if (valueapiKey != null) {
apiKey = (String)valueapiKey;
apiKey = valueapiKey;
} else {
apiKey = null;
}
imp.deletePet(petId, apiKey);
return ok();
}
@ApiAction
@ -78,8 +74,6 @@ public class PetApiController extends Controller {
}
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -96,8 +90,6 @@ public class PetApiController extends Controller {
}
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -106,8 +98,6 @@ public class PetApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -119,9 +109,7 @@ public class PetApiController extends Controller {
body.validate();
imp.updatePet(body);
return ok();
}
@ApiAction
@ -129,7 +117,7 @@ public class PetApiController extends Controller {
String valuename = (request().body().asMultipartFormData().asFormUrlEncoded().get("name"))[0];
String name;
if (valuename != null) {
name = (String)valuename;
name = valuename;
} else {
name = null;
@ -137,15 +125,13 @@ public class PetApiController extends Controller {
String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0];
String status;
if (valuestatus != null) {
status = (String)valuestatus;
status = valuestatus;
} else {
status = null;
}
imp.updatePetWithForm(petId, name, status);
return ok();
}
@ApiAction
@ -153,17 +139,15 @@ public class PetApiController extends Controller {
String valueadditionalMetadata = (request().body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata"))[0];
String additionalMetadata;
if (valueadditionalMetadata != null) {
additionalMetadata = (String)valueadditionalMetadata;
additionalMetadata = valueadditionalMetadata;
} else {
additionalMetadata = null;
}
Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file");
ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file);
ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file);
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
}

View File

@ -11,6 +11,7 @@ import java.util.HashMap;
import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface PetApiControllerImpInterface {
void addPet(Pet body) throws Exception;

View File

@ -12,7 +12,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.IOException;
import java.io.File;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -36,9 +36,7 @@ public class StoreApiController extends Controller {
@ApiAction
public Result deleteOrder(String orderId) throws Exception {
imp.deleteOrder(orderId);
return ok();
}
@ApiAction
@ -46,8 +44,6 @@ public class StoreApiController extends Controller {
Map<String, Integer> obj = imp.getInventory();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -56,8 +52,6 @@ public class StoreApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -72,7 +66,5 @@ public class StoreApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
}

View File

@ -10,6 +10,7 @@ import java.util.HashMap;
import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface StoreApiControllerImpInterface {
void deleteOrder(String orderId) throws Exception;

View File

@ -12,7 +12,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.IOException;
import java.io.File;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -42,9 +42,7 @@ public class UserApiController extends Controller {
body.validate();
imp.createUser(body);
return ok();
}
@ApiAction
@ -58,9 +56,7 @@ public class UserApiController extends Controller {
}
imp.createUsersWithArrayInput(body);
return ok();
}
@ApiAction
@ -74,17 +70,13 @@ public class UserApiController extends Controller {
}
imp.createUsersWithListInput(body);
return ok();
}
@ApiAction
public Result deleteUser(String username) throws Exception {
imp.deleteUser(username);
return ok();
}
@ApiAction
@ -93,8 +85,6 @@ public class UserApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -102,26 +92,22 @@ public class UserApiController extends Controller {
String valueusername = request().getQueryString("username");
String username;
username = (String)valueusername;
username = valueusername;
String valuepassword = request().getQueryString("password");
String password;
password = (String)valuepassword;
password = valuepassword;
String obj = imp.loginUser(username, password);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
public Result logoutUser() throws Exception {
imp.logoutUser();
return ok();
}
@ApiAction
@ -133,8 +119,6 @@ public class UserApiController extends Controller {
body.validate();
imp.updateUser(username, body);
return ok();
}
}

View File

@ -10,6 +10,7 @@ import java.util.HashMap;
import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface UserApiControllerImpInterface {
void createUser(User body) throws Exception;

View File

@ -1,11 +1,14 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
/**
* A category for a pet
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Category {
@JsonProperty("id")
private Long id = null;
@ -57,8 +60,8 @@ public class Category {
return false;
}
Category category = (Category) o;
return Objects.equals(this.id, category.id) &&
Objects.equals(this.name, category.name);
return Objects.equals(id, category.id) &&
Objects.equals(name, category.name);
}
@Override
@ -66,6 +69,7 @@ public class Category {
return Objects.hash(id, name);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,11 +1,14 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
/**
* Describes the result of uploading an image resource
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class ModelApiResponse {
@JsonProperty("code")
private Integer code = null;
@ -77,9 +80,9 @@ public class ModelApiResponse {
return false;
}
ModelApiResponse _apiResponse = (ModelApiResponse) o;
return Objects.equals(this.code, _apiResponse.code) &&
Objects.equals(this.type, _apiResponse.type) &&
Objects.equals(this.message, _apiResponse.message);
return Objects.equals(code, _apiResponse.code) &&
Objects.equals(type, _apiResponse.type) &&
Objects.equals(message, _apiResponse.message);
}
@Override
@ -87,6 +90,7 @@ public class ModelApiResponse {
return Objects.hash(code, type, message);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,12 +1,15 @@
package apimodels;
import java.util.Objects;
import java.time.OffsetDateTime;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
/**
* An order for a pets from the pet store
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Order {
@JsonProperty("id")
private Long id = null;
@ -30,7 +33,7 @@ public class Order {
DELIVERED("delivered");
private String value;
private final String value;
StatusEnum(String value) {
this.value = value;
@ -171,12 +174,12 @@ public class Order {
return false;
}
Order order = (Order) o;
return Objects.equals(this.id, order.id) &&
Objects.equals(this.petId, order.petId) &&
Objects.equals(this.quantity, order.quantity) &&
Objects.equals(this.shipDate, order.shipDate) &&
Objects.equals(this.status, order.status) &&
Objects.equals(this.complete, order.complete);
return Objects.equals(id, order.id) &&
Objects.equals(petId, order.petId) &&
Objects.equals(quantity, order.quantity) &&
Objects.equals(shipDate, order.shipDate) &&
Objects.equals(status, order.status) &&
Objects.equals(complete, order.complete);
}
@Override
@ -184,6 +187,7 @@ public class Order {
return Objects.hash(id, petId, quantity, shipDate, status, complete);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,15 +1,18 @@
package apimodels;
import java.util.Objects;
import apimodels.Category;
import apimodels.Tag;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
/**
* A pet for sale in the pet store
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Pet {
@JsonProperty("id")
private Long id = null;
@ -21,7 +24,7 @@ public class Pet {
private String name = null;
@JsonProperty("photoUrls")
private List<String> photoUrls = new ArrayList<String>();
private List<String> photoUrls = new ArrayList<>();
@JsonProperty("tags")
private List<Tag> tags = null;
@ -36,7 +39,7 @@ public class Pet {
SOLD("sold");
private String value;
private final String value;
StatusEnum(String value) {
this.value = value;
@ -119,7 +122,7 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
this.photoUrls.add(photoUrlsItem);
photoUrls.add(photoUrlsItem);
return this;
}
@ -141,10 +144,10 @@ public class Pet {
}
public Pet addTagsItem(Tag tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<Tag>();
if (tags == null) {
tags = new ArrayList<>();
}
this.tags.add(tagsItem);
tags.add(tagsItem);
return this;
}
@ -187,12 +190,12 @@ public class Pet {
return false;
}
Pet pet = (Pet) o;
return Objects.equals(this.id, pet.id) &&
Objects.equals(this.category, pet.category) &&
Objects.equals(this.name, pet.name) &&
Objects.equals(this.photoUrls, pet.photoUrls) &&
Objects.equals(this.tags, pet.tags) &&
Objects.equals(this.status, pet.status);
return Objects.equals(id, pet.id) &&
Objects.equals(category, pet.category) &&
Objects.equals(name, pet.name) &&
Objects.equals(photoUrls, pet.photoUrls) &&
Objects.equals(tags, pet.tags) &&
Objects.equals(status, pet.status);
}
@Override
@ -200,6 +203,7 @@ public class Pet {
return Objects.hash(id, category, name, photoUrls, tags, status);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,11 +1,14 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
/**
* A tag for a pet
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Tag {
@JsonProperty("id")
private Long id = null;
@ -57,8 +60,8 @@ public class Tag {
return false;
}
Tag tag = (Tag) o;
return Objects.equals(this.id, tag.id) &&
Objects.equals(this.name, tag.name);
return Objects.equals(id, tag.id) &&
Objects.equals(name, tag.name);
}
@Override
@ -66,6 +69,7 @@ public class Tag {
return Objects.hash(id, name);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,11 +1,14 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
/**
* A User who is purchasing from the pet store
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class User {
@JsonProperty("id")
private Long id = null;
@ -177,14 +180,14 @@ public class User {
return false;
}
User user = (User) o;
return Objects.equals(this.id, user.id) &&
Objects.equals(this.username, user.username) &&
Objects.equals(this.firstName, user.firstName) &&
Objects.equals(this.lastName, user.lastName) &&
Objects.equals(this.email, user.email) &&
Objects.equals(this.password, user.password) &&
Objects.equals(this.phone, user.phone) &&
Objects.equals(this.userStatus, user.userStatus);
return Objects.equals(id, user.id) &&
Objects.equals(username, user.username) &&
Objects.equals(firstName, user.firstName) &&
Objects.equals(lastName, user.lastName) &&
Objects.equals(email, user.email) &&
Objects.equals(password, user.password) &&
Objects.equals(phone, user.phone) &&
Objects.equals(userStatus, user.userStatus);
}
@Override
@ -192,6 +195,7 @@ public class User {
return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -13,7 +13,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.IOException;
import java.io.File;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -41,9 +41,7 @@ public class PetApiController extends Controller {
body = mapper.readValue(nodebody.toString(), Pet.class);
imp.addPet(body);
return ok();
}
@ApiAction
@ -51,15 +49,13 @@ public class PetApiController extends Controller {
String valueapiKey = request().getHeader("api_key");
String apiKey;
if (valueapiKey != null) {
apiKey = (String)valueapiKey;
apiKey = valueapiKey;
} else {
apiKey = null;
}
imp.deletePet(petId, apiKey);
return ok();
}
@ApiAction
@ -73,8 +69,6 @@ public class PetApiController extends Controller {
List<Pet> obj = imp.findPetsByStatus(status);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -88,8 +82,6 @@ public class PetApiController extends Controller {
List<Pet> obj = imp.findPetsByTags(tags);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -97,8 +89,6 @@ public class PetApiController extends Controller {
Pet obj = imp.getPetById(petId);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -109,9 +99,7 @@ public class PetApiController extends Controller {
body = mapper.readValue(nodebody.toString(), Pet.class);
imp.updatePet(body);
return ok();
}
@ApiAction
@ -119,7 +107,7 @@ public class PetApiController extends Controller {
String valuename = (request().body().asMultipartFormData().asFormUrlEncoded().get("name"))[0];
String name;
if (valuename != null) {
name = (String)valuename;
name = valuename;
} else {
name = null;
@ -127,15 +115,13 @@ public class PetApiController extends Controller {
String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0];
String status;
if (valuestatus != null) {
status = (String)valuestatus;
status = valuestatus;
} else {
status = null;
}
imp.updatePetWithForm(petId, name, status);
return ok();
}
@ApiAction
@ -143,16 +129,14 @@ public class PetApiController extends Controller {
String valueadditionalMetadata = (request().body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata"))[0];
String additionalMetadata;
if (valueadditionalMetadata != null) {
additionalMetadata = (String)valueadditionalMetadata;
additionalMetadata = valueadditionalMetadata;
} else {
additionalMetadata = null;
}
Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file");
ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file);
ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
}

View File

@ -10,6 +10,7 @@ import java.util.ArrayList;
import java.util.HashMap;
@SuppressWarnings("RedundantThrows")
public interface PetApiControllerImpInterface {
void addPet(Pet body) throws Exception;

View File

@ -12,7 +12,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.IOException;
import java.io.File;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -35,9 +35,7 @@ public class StoreApiController extends Controller {
@ApiAction
public Result deleteOrder(String orderId) throws Exception {
imp.deleteOrder(orderId);
return ok();
}
@ApiAction
@ -45,8 +43,6 @@ public class StoreApiController extends Controller {
Map<String, Integer> obj = imp.getInventory();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -54,8 +50,6 @@ public class StoreApiController extends Controller {
Order obj = imp.getOrderById(orderId);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -68,7 +62,5 @@ public class StoreApiController extends Controller {
Order obj = imp.placeOrder(body);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
}

View File

@ -9,6 +9,7 @@ import java.util.ArrayList;
import java.util.HashMap;
@SuppressWarnings("RedundantThrows")
public interface StoreApiControllerImpInterface {
void deleteOrder(String orderId) throws Exception;

View File

@ -12,7 +12,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.IOException;
import java.io.File;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -40,9 +40,7 @@ public class UserApiController extends Controller {
body = mapper.readValue(nodebody.toString(), User.class);
imp.createUser(body);
return ok();
}
@ApiAction
@ -53,9 +51,7 @@ public class UserApiController extends Controller {
body = mapper.readValue(nodebody.toString(), new TypeReference<List<User>>(){});
imp.createUsersWithArrayInput(body);
return ok();
}
@ApiAction
@ -66,17 +62,13 @@ public class UserApiController extends Controller {
body = mapper.readValue(nodebody.toString(), new TypeReference<List<User>>(){});
imp.createUsersWithListInput(body);
return ok();
}
@ApiAction
public Result deleteUser(String username) throws Exception {
imp.deleteUser(username);
return ok();
}
@ApiAction
@ -84,8 +76,6 @@ public class UserApiController extends Controller {
User obj = imp.getUserByName(username);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -93,26 +83,22 @@ public class UserApiController extends Controller {
String valueusername = request().getQueryString("username");
String username;
username = (String)valueusername;
username = valueusername;
String valuepassword = request().getQueryString("password");
String password;
password = (String)valuepassword;
password = valuepassword;
String obj = imp.loginUser(username, password);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
public Result logoutUser() throws Exception {
imp.logoutUser();
return ok();
}
@ApiAction
@ -123,8 +109,6 @@ public class UserApiController extends Controller {
body = mapper.readValue(nodebody.toString(), User.class);
imp.updateUser(username, body);
return ok();
}
}

View File

@ -9,6 +9,7 @@ import java.util.ArrayList;
import java.util.HashMap;
@SuppressWarnings("RedundantThrows")
public interface UserApiControllerImpInterface {
void createUser(User body) throws Exception;

View File

@ -1 +0,0 @@
2017-08-08 12:59:36,779 [INFO] from play.api.Play in ForkJoinPool-1-worker-1 - Application started (Dev)

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* A category for a pet
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Category {
@JsonProperty("id")
private Long id = null;
@ -60,8 +61,8 @@ public class Category {
return false;
}
Category category = (Category) o;
return Objects.equals(this.id, category.id) &&
Objects.equals(this.name, category.name);
return Objects.equals(id, category.id) &&
Objects.equals(name, category.name);
}
@Override
@ -69,6 +70,7 @@ public class Category {
return Objects.hash(id, name);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Describes the result of uploading an image resource
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class ModelApiResponse {
@JsonProperty("code")
private Integer code = null;
@ -80,9 +81,9 @@ public class ModelApiResponse {
return false;
}
ModelApiResponse _apiResponse = (ModelApiResponse) o;
return Objects.equals(this.code, _apiResponse.code) &&
Objects.equals(this.type, _apiResponse.type) &&
Objects.equals(this.message, _apiResponse.message);
return Objects.equals(code, _apiResponse.code) &&
Objects.equals(type, _apiResponse.type) &&
Objects.equals(message, _apiResponse.message);
}
@Override
@ -90,6 +91,7 @@ public class ModelApiResponse {
return Objects.hash(code, type, message);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,15 +1,16 @@
package apimodels;
import java.util.Objects;
import java.time.OffsetDateTime;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* An order for a pets from the pet store
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Order {
@JsonProperty("id")
private Long id = null;
@ -33,7 +34,7 @@ public class Order {
DELIVERED("delivered");
private String value;
private final String value;
StatusEnum(String value) {
this.value = value;
@ -175,12 +176,12 @@ public class Order {
return false;
}
Order order = (Order) o;
return Objects.equals(this.id, order.id) &&
Objects.equals(this.petId, order.petId) &&
Objects.equals(this.quantity, order.quantity) &&
Objects.equals(this.shipDate, order.shipDate) &&
Objects.equals(this.status, order.status) &&
Objects.equals(this.complete, order.complete);
return Objects.equals(id, order.id) &&
Objects.equals(petId, order.petId) &&
Objects.equals(quantity, order.quantity) &&
Objects.equals(shipDate, order.shipDate) &&
Objects.equals(status, order.status) &&
Objects.equals(complete, order.complete);
}
@Override
@ -188,6 +189,7 @@ public class Order {
return Objects.hash(id, petId, quantity, shipDate, status, complete);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,6 +1,5 @@
package apimodels;
import java.util.Objects;
import apimodels.Category;
import apimodels.Tag;
import java.util.ArrayList;
@ -8,11 +7,13 @@ import java.util.List;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* A pet for sale in the pet store
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Pet {
@JsonProperty("id")
private Long id = null;
@ -24,7 +25,7 @@ public class Pet {
private String name = null;
@JsonProperty("photoUrls")
private List<String> photoUrls = new ArrayList<String>();
private List<String> photoUrls = new ArrayList<>();
@JsonProperty("tags")
private List<Tag> tags = null;
@ -39,7 +40,7 @@ public class Pet {
SOLD("sold");
private String value;
private final String value;
StatusEnum(String value) {
this.value = value;
@ -124,7 +125,7 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
this.photoUrls.add(photoUrlsItem);
photoUrls.add(photoUrlsItem);
return this;
}
@ -147,10 +148,10 @@ public class Pet {
}
public Pet addTagsItem(Tag tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<Tag>();
if (tags == null) {
tags = new ArrayList<>();
}
this.tags.add(tagsItem);
tags.add(tagsItem);
return this;
}
@ -194,12 +195,12 @@ public class Pet {
return false;
}
Pet pet = (Pet) o;
return Objects.equals(this.id, pet.id) &&
Objects.equals(this.category, pet.category) &&
Objects.equals(this.name, pet.name) &&
Objects.equals(this.photoUrls, pet.photoUrls) &&
Objects.equals(this.tags, pet.tags) &&
Objects.equals(this.status, pet.status);
return Objects.equals(id, pet.id) &&
Objects.equals(category, pet.category) &&
Objects.equals(name, pet.name) &&
Objects.equals(photoUrls, pet.photoUrls) &&
Objects.equals(tags, pet.tags) &&
Objects.equals(status, pet.status);
}
@Override
@ -207,6 +208,7 @@ public class Pet {
return Objects.hash(id, category, name, photoUrls, tags, status);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* A tag for a pet
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Tag {
@JsonProperty("id")
private Long id = null;
@ -60,8 +61,8 @@ public class Tag {
return false;
}
Tag tag = (Tag) o;
return Objects.equals(this.id, tag.id) &&
Objects.equals(this.name, tag.name);
return Objects.equals(id, tag.id) &&
Objects.equals(name, tag.name);
}
@Override
@ -69,6 +70,7 @@ public class Tag {
return Objects.hash(id, name);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* A User who is purchasing from the pet store
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class User {
@JsonProperty("id")
private Long id = null;
@ -180,14 +181,14 @@ public class User {
return false;
}
User user = (User) o;
return Objects.equals(this.id, user.id) &&
Objects.equals(this.username, user.username) &&
Objects.equals(this.firstName, user.firstName) &&
Objects.equals(this.lastName, user.lastName) &&
Objects.equals(this.email, user.email) &&
Objects.equals(this.password, user.password) &&
Objects.equals(this.phone, user.phone) &&
Objects.equals(this.userStatus, user.userStatus);
return Objects.equals(id, user.id) &&
Objects.equals(username, user.username) &&
Objects.equals(firstName, user.firstName) &&
Objects.equals(lastName, user.lastName) &&
Objects.equals(email, user.email) &&
Objects.equals(password, user.password) &&
Objects.equals(phone, user.phone) &&
Objects.equals(userStatus, user.userStatus);
}
@Override
@ -195,6 +196,7 @@ public class User {
return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -13,6 +13,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.File;
import java.io.IOException;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -43,9 +44,7 @@ public class PetApiController extends Controller {
body.validate();
imp.addPet(body);
return ok();
}
@ApiAction
@ -53,15 +52,13 @@ public class PetApiController extends Controller {
String valueapiKey = request().getHeader("api_key");
String apiKey;
if (valueapiKey != null) {
apiKey = (String)valueapiKey;
apiKey = valueapiKey;
} else {
apiKey = null;
}
imp.deletePet(petId, apiKey);
return ok();
}
@ApiAction
@ -78,8 +75,6 @@ public class PetApiController extends Controller {
}
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -96,8 +91,6 @@ public class PetApiController extends Controller {
}
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -106,8 +99,6 @@ public class PetApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -119,9 +110,7 @@ public class PetApiController extends Controller {
body.validate();
imp.updatePet(body);
return ok();
}
@ApiAction
@ -129,7 +118,7 @@ public class PetApiController extends Controller {
String valuename = (request().body().asMultipartFormData().asFormUrlEncoded().get("name"))[0];
String name;
if (valuename != null) {
name = (String)valuename;
name = valuename;
} else {
name = null;
@ -137,15 +126,13 @@ public class PetApiController extends Controller {
String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0];
String status;
if (valuestatus != null) {
status = (String)valuestatus;
status = valuestatus;
} else {
status = null;
}
imp.updatePetWithForm(petId, name, status);
return ok();
}
@ApiAction
@ -153,17 +140,15 @@ public class PetApiController extends Controller {
String valueadditionalMetadata = (request().body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata"))[0];
String additionalMetadata;
if (valueadditionalMetadata != null) {
additionalMetadata = (String)valueadditionalMetadata;
additionalMetadata = valueadditionalMetadata;
} else {
additionalMetadata = null;
}
Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file");
ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file);
ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file);
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
}

View File

@ -11,6 +11,7 @@ import java.util.HashMap;
import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface PetApiControllerImpInterface {
void addPet(Pet body) ;

View File

@ -12,6 +12,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.File;
import java.io.IOException;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -36,9 +37,7 @@ public class StoreApiController extends Controller {
@ApiAction
public Result deleteOrder(String orderId) {
imp.deleteOrder(orderId);
return ok();
}
@ApiAction
@ -46,8 +45,6 @@ public class StoreApiController extends Controller {
Map<String, Integer> obj = imp.getInventory();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -56,8 +53,6 @@ public class StoreApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -72,7 +67,5 @@ public class StoreApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
}

View File

@ -10,6 +10,7 @@ import java.util.HashMap;
import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface StoreApiControllerImpInterface {
void deleteOrder(String orderId) ;

View File

@ -12,6 +12,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.File;
import java.io.IOException;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -42,9 +43,7 @@ public class UserApiController extends Controller {
body.validate();
imp.createUser(body);
return ok();
}
@ApiAction
@ -58,9 +57,7 @@ public class UserApiController extends Controller {
}
imp.createUsersWithArrayInput(body);
return ok();
}
@ApiAction
@ -74,17 +71,13 @@ public class UserApiController extends Controller {
}
imp.createUsersWithListInput(body);
return ok();
}
@ApiAction
public Result deleteUser(String username) {
imp.deleteUser(username);
return ok();
}
@ApiAction
@ -93,8 +86,6 @@ public class UserApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -102,26 +93,22 @@ public class UserApiController extends Controller {
String valueusername = request().getQueryString("username");
String username;
username = (String)valueusername;
username = valueusername;
String valuepassword = request().getQueryString("password");
String password;
password = (String)valuepassword;
password = valuepassword;
String obj = imp.loginUser(username, password);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
public Result logoutUser() {
imp.logoutUser();
return ok();
}
@ApiAction
@ -133,8 +120,6 @@ public class UserApiController extends Controller {
body.validate();
imp.updateUser(username, body);
return ok();
}
}

View File

@ -10,6 +10,7 @@ import java.util.HashMap;
import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface UserApiControllerImpInterface {
void createUser(User body) ;

View File

@ -1 +0,0 @@
2017-08-08 13:00:03,356 [INFO] from play.api.Play in ForkJoinPool-1-worker-1 - Application started (Dev)

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* A category for a pet
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Category {
@JsonProperty("id")
private Long id = null;
@ -60,8 +61,8 @@ public class Category {
return false;
}
Category category = (Category) o;
return Objects.equals(this.id, category.id) &&
Objects.equals(this.name, category.name);
return Objects.equals(id, category.id) &&
Objects.equals(name, category.name);
}
@Override
@ -69,6 +70,7 @@ public class Category {
return Objects.hash(id, name);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* Describes the result of uploading an image resource
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class ModelApiResponse {
@JsonProperty("code")
private Integer code = null;
@ -80,9 +81,9 @@ public class ModelApiResponse {
return false;
}
ModelApiResponse _apiResponse = (ModelApiResponse) o;
return Objects.equals(this.code, _apiResponse.code) &&
Objects.equals(this.type, _apiResponse.type) &&
Objects.equals(this.message, _apiResponse.message);
return Objects.equals(code, _apiResponse.code) &&
Objects.equals(type, _apiResponse.type) &&
Objects.equals(message, _apiResponse.message);
}
@Override
@ -90,6 +91,7 @@ public class ModelApiResponse {
return Objects.hash(code, type, message);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,15 +1,16 @@
package apimodels;
import java.util.Objects;
import java.time.OffsetDateTime;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* An order for a pets from the pet store
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Order {
@JsonProperty("id")
private Long id = null;
@ -33,7 +34,7 @@ public class Order {
DELIVERED("delivered");
private String value;
private final String value;
StatusEnum(String value) {
this.value = value;
@ -175,12 +176,12 @@ public class Order {
return false;
}
Order order = (Order) o;
return Objects.equals(this.id, order.id) &&
Objects.equals(this.petId, order.petId) &&
Objects.equals(this.quantity, order.quantity) &&
Objects.equals(this.shipDate, order.shipDate) &&
Objects.equals(this.status, order.status) &&
Objects.equals(this.complete, order.complete);
return Objects.equals(id, order.id) &&
Objects.equals(petId, order.petId) &&
Objects.equals(quantity, order.quantity) &&
Objects.equals(shipDate, order.shipDate) &&
Objects.equals(status, order.status) &&
Objects.equals(complete, order.complete);
}
@Override
@ -188,6 +189,7 @@ public class Order {
return Objects.hash(id, petId, quantity, shipDate, status, complete);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,6 +1,5 @@
package apimodels;
import java.util.Objects;
import apimodels.Category;
import apimodels.Tag;
import java.util.ArrayList;
@ -8,11 +7,13 @@ import java.util.List;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* A pet for sale in the pet store
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Pet {
@JsonProperty("id")
private Long id = null;
@ -24,7 +25,7 @@ public class Pet {
private String name = null;
@JsonProperty("photoUrls")
private List<String> photoUrls = new ArrayList<String>();
private List<String> photoUrls = new ArrayList<>();
@JsonProperty("tags")
private List<Tag> tags = null;
@ -39,7 +40,7 @@ public class Pet {
SOLD("sold");
private String value;
private final String value;
StatusEnum(String value) {
this.value = value;
@ -124,7 +125,7 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
this.photoUrls.add(photoUrlsItem);
photoUrls.add(photoUrlsItem);
return this;
}
@ -147,10 +148,10 @@ public class Pet {
}
public Pet addTagsItem(Tag tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<Tag>();
if (tags == null) {
tags = new ArrayList<>();
}
this.tags.add(tagsItem);
tags.add(tagsItem);
return this;
}
@ -194,12 +195,12 @@ public class Pet {
return false;
}
Pet pet = (Pet) o;
return Objects.equals(this.id, pet.id) &&
Objects.equals(this.category, pet.category) &&
Objects.equals(this.name, pet.name) &&
Objects.equals(this.photoUrls, pet.photoUrls) &&
Objects.equals(this.tags, pet.tags) &&
Objects.equals(this.status, pet.status);
return Objects.equals(id, pet.id) &&
Objects.equals(category, pet.category) &&
Objects.equals(name, pet.name) &&
Objects.equals(photoUrls, pet.photoUrls) &&
Objects.equals(tags, pet.tags) &&
Objects.equals(status, pet.status);
}
@Override
@ -207,6 +208,7 @@ public class Pet {
return Objects.hash(id, category, name, photoUrls, tags, status);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* A tag for a pet
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class Tag {
@JsonProperty("id")
private Long id = null;
@ -60,8 +61,8 @@ public class Tag {
return false;
}
Tag tag = (Tag) o;
return Objects.equals(this.id, tag.id) &&
Objects.equals(this.name, tag.name);
return Objects.equals(id, tag.id) &&
Objects.equals(name, tag.name);
}
@Override
@ -69,6 +70,7 @@ public class Tag {
return Objects.hash(id, name);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -1,14 +1,15 @@
package apimodels;
import java.util.Objects;
import com.fasterxml.jackson.annotation.*;
import java.util.Set;
import javax.validation.*;
import java.util.Objects;
import javax.validation.constraints.*;
/**
* A User who is purchasing from the pet store
*/
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class User {
@JsonProperty("id")
private Long id = null;
@ -180,14 +181,14 @@ public class User {
return false;
}
User user = (User) o;
return Objects.equals(this.id, user.id) &&
Objects.equals(this.username, user.username) &&
Objects.equals(this.firstName, user.firstName) &&
Objects.equals(this.lastName, user.lastName) &&
Objects.equals(this.email, user.email) &&
Objects.equals(this.password, user.password) &&
Objects.equals(this.phone, user.phone) &&
Objects.equals(this.userStatus, user.userStatus);
return Objects.equals(id, user.id) &&
Objects.equals(username, user.username) &&
Objects.equals(firstName, user.firstName) &&
Objects.equals(lastName, user.lastName) &&
Objects.equals(email, user.email) &&
Objects.equals(password, user.password) &&
Objects.equals(phone, user.phone) &&
Objects.equals(userStatus, user.userStatus);
}
@Override
@ -195,6 +196,7 @@ public class User {
return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus);
}
@SuppressWarnings("StringBufferReplaceableByString")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -13,7 +13,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.IOException;
import java.io.File;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -43,9 +43,7 @@ public class PetApiController extends Controller {
body.validate();
imp.addPet(body);
return ok();
}
@ApiAction
@ -53,15 +51,13 @@ public class PetApiController extends Controller {
String valueapiKey = request().getHeader("api_key");
String apiKey;
if (valueapiKey != null) {
apiKey = (String)valueapiKey;
apiKey = valueapiKey;
} else {
apiKey = null;
}
imp.deletePet(petId, apiKey);
return ok();
}
@ApiAction
@ -78,8 +74,6 @@ public class PetApiController extends Controller {
}
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -96,8 +90,6 @@ public class PetApiController extends Controller {
}
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -106,8 +98,6 @@ public class PetApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -119,9 +109,7 @@ public class PetApiController extends Controller {
body.validate();
imp.updatePet(body);
return ok();
}
@ApiAction
@ -129,7 +117,7 @@ public class PetApiController extends Controller {
String valuename = (request().body().asMultipartFormData().asFormUrlEncoded().get("name"))[0];
String name;
if (valuename != null) {
name = (String)valuename;
name = valuename;
} else {
name = null;
@ -137,15 +125,13 @@ public class PetApiController extends Controller {
String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0];
String status;
if (valuestatus != null) {
status = (String)valuestatus;
status = valuestatus;
} else {
status = null;
}
imp.updatePetWithForm(petId, name, status);
return ok();
}
@ApiAction
@ -153,17 +139,15 @@ public class PetApiController extends Controller {
String valueadditionalMetadata = (request().body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata"))[0];
String additionalMetadata;
if (valueadditionalMetadata != null) {
additionalMetadata = (String)valueadditionalMetadata;
additionalMetadata = valueadditionalMetadata;
} else {
additionalMetadata = null;
}
Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file");
ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file);
ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file);
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
}

View File

@ -0,0 +1,32 @@
package controllers;
import java.io.InputStream;
import apimodels.ModelApiResponse;
import apimodels.Pet;
import play.mvc.Http;
import java.util.List;
import java.util.ArrayList;
import java.util.HashMap;
import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
interface PetApiControllerImpInterface {
void addPet(Pet body) throws Exception;
void deletePet(Long petId, String apiKey) throws Exception;
List<Pet> findPetsByStatus( @NotNull List<String> status) throws Exception;
List<Pet> findPetsByTags( @NotNull List<String> tags) throws Exception;
Pet getPetById(Long petId) throws Exception;
void updatePet(Pet body) throws Exception;
void updatePetWithForm(Long petId, String name, String status) throws Exception;
ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception;
}

View File

@ -12,7 +12,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.IOException;
import java.io.File;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -36,9 +36,7 @@ public class StoreApiController extends Controller {
@ApiAction
public Result deleteOrder(String orderId) throws Exception {
imp.deleteOrder(orderId);
return ok();
}
@ApiAction
@ -46,8 +44,6 @@ public class StoreApiController extends Controller {
Map<String, Integer> obj = imp.getInventory();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -56,8 +52,6 @@ public class StoreApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -72,7 +66,5 @@ public class StoreApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
}

View File

@ -0,0 +1,23 @@
package controllers;
import java.util.Map;
import apimodels.Order;
import play.mvc.Http;
import java.util.List;
import java.util.ArrayList;
import java.util.HashMap;
import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
interface StoreApiControllerImpInterface {
void deleteOrder(String orderId) throws Exception;
Map<String, Integer> getInventory() throws Exception;
Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception;
Order placeOrder(Order body) throws Exception;
}

View File

@ -12,7 +12,7 @@ import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.IOException;
import java.io.File;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
@ -42,9 +42,7 @@ public class UserApiController extends Controller {
body.validate();
imp.createUser(body);
return ok();
}
@ApiAction
@ -58,9 +56,7 @@ public class UserApiController extends Controller {
}
imp.createUsersWithArrayInput(body);
return ok();
}
@ApiAction
@ -74,17 +70,13 @@ public class UserApiController extends Controller {
}
imp.createUsersWithListInput(body);
return ok();
}
@ApiAction
public Result deleteUser(String username) throws Exception {
imp.deleteUser(username);
return ok();
}
@ApiAction
@ -93,8 +85,6 @@ public class UserApiController extends Controller {
obj.validate();
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
@ -102,26 +92,22 @@ public class UserApiController extends Controller {
String valueusername = request().getQueryString("username");
String username;
username = (String)valueusername;
username = valueusername;
String valuepassword = request().getQueryString("password");
String password;
password = (String)valuepassword;
password = valuepassword;
String obj = imp.loginUser(username, password);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
public Result logoutUser() throws Exception {
imp.logoutUser();
return ok();
}
@ApiAction
@ -133,8 +119,6 @@ public class UserApiController extends Controller {
body.validate();
imp.updateUser(username, body);
return ok();
}
}

View File

@ -0,0 +1,31 @@
package controllers;
import java.util.List;
import apimodels.User;
import play.mvc.Http;
import java.util.List;
import java.util.ArrayList;
import java.util.HashMap;
import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
interface UserApiControllerImpInterface {
void createUser(User body) throws Exception;
void createUsersWithArrayInput(List<User> body) throws Exception;
void createUsersWithListInput(List<User> body) throws Exception;
void deleteUser(String username) throws Exception;
User getUserByName(String username) throws Exception;
String loginUser( @NotNull String username, @NotNull String password) throws Exception;
void logoutUser() throws Exception;
void updateUser(String username, User body) throws Exception;
}

Some files were not shown because too many files have changed in this diff Show More